S
shang_yan
Unregistered / Unconfirmed
GUEST, unregistred user!
我做了一个进程外的自动化服务器程序,然后我又做了一个调用它的客户程序,我想在这个客户
程序关闭后而自动化服务器程序却不关闭。
有人说要用到addref,但我不知要如何用,请告诉我。下面是部份源代码:
unit geturl_com;
interface
uses
ComObj, ActiveX, GetUrl_TLB, StdVcl,mainform;
type
TGetUrlobj = class(TAutoObject, IGetUrlobj)
protected
procedure GetUrl; safecall;
{ Protected declarations }
end;
implementation
uses ComServ;
procedure TGetUrlobj.GetUrl;
begin
form1.GetUrl;
end;
initialization
TAutoObjectFactory.Create(ComServer, TGetUrlobj, Class_GetUrlobj,
ciSingleInstance, tmApartment);
end.
程序关闭后而自动化服务器程序却不关闭。
有人说要用到addref,但我不知要如何用,请告诉我。下面是部份源代码:
unit geturl_com;
interface
uses
ComObj, ActiveX, GetUrl_TLB, StdVcl,mainform;
type
TGetUrlobj = class(TAutoObject, IGetUrlobj)
protected
procedure GetUrl; safecall;
{ Protected declarations }
end;
implementation
uses ComServ;
procedure TGetUrlobj.GetUrl;
begin
form1.GetUrl;
end;
initialization
TAutoObjectFactory.Create(ComServer, TGetUrlobj, Class_GetUrlobj,
ciSingleInstance, tmApartment);
end.