我想问一下在 Delphi中如何写一个组件,在ASP中调用它!
我想问一下在 Delphi中如何写一个组件,在ASP中调用它!
楼主gross1215(粗人)2003-06-05 18:40:18 在 Delphi / 网络通信/分布式开发 提问我想问一下在 Delphi中如何写一个组件,在ASP中调用它!请高手帮忙!最好有源码说明,谢谢! 问题点数:0、回复次数:2Top
1 楼qwertyasd(昊)回复于 2003-06-05 18:47:15 得分 0
new->activex->automation
源码
unit Unit1;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
ComObj, ActiveX, iprttest3_TLB, StdVcl,Printers,Windows;
type
Tprint = class(TAutoObject, Iprint)
protected
procedure printtext; safecall;
end;
implementation
uses ComServ;
procedure Tprint.printtext;
var
Device: array of char;
Driver: array of char;
Port: array of char;
hDMode: THandle;
PDMode: PDEVMODE;
begin
//设置打印机
Printer.PrinterIndex := Printer.PrinterIndex;
Printer.GetPrinter(Device, Driver, Port, hDMode);
if hDMode <> 0 then
begin
pDMode := GlobalLock(hDMode);
if pDMode <> nil then
begin
//设定纸张类型
pDMode^.dmFields := pDMode^.dmFields or
DM_PAPERSIZE ;
pDMode^.dmPaperSize := DMPAPER_A4;
GlobalUnlock(hDMode);
end;
end ;
Printer.PrinterIndex := Printer.PrinterIndex;
Printer.BeginDoc;
Printer.Canvas.TextOut(100,100,"sssssssssss");
Printer.EndDoc;
end;
initialization
TAutoObjectFactory.Create(ComServer, Tprint, Class_print,
ciMultiInstance, tmApartment);
end.
asp代码
<% @Language = "VBScript" %>
<html>
<%
sub testprtobject
dim prtobject
set prtobject=createobject("iprttest3.print")
prtobject.printtext
set prtobject=nothing
end sub
testprtobject()
%>Top
2 楼qwertyasd(昊)回复于 2003-06-05 18:47:42 得分 0
要再详细,自己喳喳资料吧!Top
-
相关文章
2秒记住本站域名
玩过泡泡龙吗?Readygo?Go! 再加上.Com.Cn的后缀,那就是大名小顶的readygo.com.cn
