Z
zhousi
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Project1_TLB;
interface
uses Windows, ActiveX, Classes, Graphics, Midas, StdVCL, Variants;
const
Project1MajorVersion = 1;
Project1MinorVersion = 0;
LIBID_Project1: TGUID = '{5EE3CDF8-B351-4DB3-BA78-1F14AA78B940}';
IID_Itest: TGUID = '{1BD9A3DF-C462-4DC9-953C-21835631EAB0}';
CLASS_test: TGUID = '{0C34233D-49BA-42FD-AABA-F1A46F19473F}'; //类工厂的guid
type
Itest = interface;
ItestDisp = dispinterface;
test = Itest;
Itest = interface(IAppServer)
['{1BD9A3DF-C462-4DC9-953C-21835631EAB0}']
procedure ddf(aa: Integer); safecall;
end;
ItestDisp = dispinterface
['{1BD9A3DF-C462-4DC9-953C-21835631EAB0}']
procedure ddf(aa: Integer); dispid 1;
function AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; MaxErrors: Integer;
out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; dispid 20000000;
function AS_GetRecords(const ProviderName: WideString; Count: Integer; out RecsOut: Integer;
Options: Integer; const CommandText: WideString; var Params: OleVariant;
var OwnerData: OleVariant): OleVariant; dispid 20000001;
function AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; dispid 20000002;
function AS_GetProviderNames: OleVariant; dispid 20000003;
function AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant; dispid 20000004;
function AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer;
var OwnerData: OleVariant): OleVariant; dispid 20000005;
procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString;
var Params: OleVariant; var OwnerData: OleVariant); dispid 20000006;
end;
Cotest = class
class function Create: Itest;
class function CreateRemote(const MachineName: string): Itest;
end;
implementation
uses ComObj;
class function Cotest.Create: Itest;
begin
Result := CreateComObject(CLASS_test) as Itest;
end;
class function Cotest.CreateRemote(const MachineName: string): Itest;
begin
Result := CreateRemoteComObject(MachineName, CLASS_test) as Itest;
end;
end.
1。Project1MajorVersion,Project1MinorVersion 不知道做什么用的一直不明白。
2。guid使用
LIBID_Project1: TGUID = '{5EE3CDF8-B351-4DB3-BA78-1F14AA78B940}';
IID_Itest: TGUID = '{1BD9A3DF-C462-4DC9-953C-21835631EAB0}';
不知道在什么地方用
CLASS_test 应该是类工厂的guid
3。test = Itest;
定义test是Itest接口类型的,好像没用到。不知道生成出来做什么
4。ItestDisp = dispinterface
dispinterface不知道做什么用,每增加个方法,Itest和ItestDisp都要添加。
5。就是Cotest类。。为什么还要在com里有这个类。调用CreateComObject和CreateRemoteComObject
这两个方法应该在客户端或外界使用嘛。在com里使用到了?
interface
uses Windows, ActiveX, Classes, Graphics, Midas, StdVCL, Variants;
const
Project1MajorVersion = 1;
Project1MinorVersion = 0;
LIBID_Project1: TGUID = '{5EE3CDF8-B351-4DB3-BA78-1F14AA78B940}';
IID_Itest: TGUID = '{1BD9A3DF-C462-4DC9-953C-21835631EAB0}';
CLASS_test: TGUID = '{0C34233D-49BA-42FD-AABA-F1A46F19473F}'; //类工厂的guid
type
Itest = interface;
ItestDisp = dispinterface;
test = Itest;
Itest = interface(IAppServer)
['{1BD9A3DF-C462-4DC9-953C-21835631EAB0}']
procedure ddf(aa: Integer); safecall;
end;
ItestDisp = dispinterface
['{1BD9A3DF-C462-4DC9-953C-21835631EAB0}']
procedure ddf(aa: Integer); dispid 1;
function AS_ApplyUpdates(const ProviderName: WideString; Delta: OleVariant; MaxErrors: Integer;
out ErrorCount: Integer; var OwnerData: OleVariant): OleVariant; dispid 20000000;
function AS_GetRecords(const ProviderName: WideString; Count: Integer; out RecsOut: Integer;
Options: Integer; const CommandText: WideString; var Params: OleVariant;
var OwnerData: OleVariant): OleVariant; dispid 20000001;
function AS_DataRequest(const ProviderName: WideString; Data: OleVariant): OleVariant; dispid 20000002;
function AS_GetProviderNames: OleVariant; dispid 20000003;
function AS_GetParams(const ProviderName: WideString; var OwnerData: OleVariant): OleVariant; dispid 20000004;
function AS_RowRequest(const ProviderName: WideString; Row: OleVariant; RequestType: Integer;
var OwnerData: OleVariant): OleVariant; dispid 20000005;
procedure AS_Execute(const ProviderName: WideString; const CommandText: WideString;
var Params: OleVariant; var OwnerData: OleVariant); dispid 20000006;
end;
Cotest = class
class function Create: Itest;
class function CreateRemote(const MachineName: string): Itest;
end;
implementation
uses ComObj;
class function Cotest.Create: Itest;
begin
Result := CreateComObject(CLASS_test) as Itest;
end;
class function Cotest.CreateRemote(const MachineName: string): Itest;
begin
Result := CreateRemoteComObject(MachineName, CLASS_test) as Itest;
end;
end.
1。Project1MajorVersion,Project1MinorVersion 不知道做什么用的一直不明白。
2。guid使用
LIBID_Project1: TGUID = '{5EE3CDF8-B351-4DB3-BA78-1F14AA78B940}';
IID_Itest: TGUID = '{1BD9A3DF-C462-4DC9-953C-21835631EAB0}';
不知道在什么地方用
CLASS_test 应该是类工厂的guid
3。test = Itest;
定义test是Itest接口类型的,好像没用到。不知道生成出来做什么
4。ItestDisp = dispinterface
dispinterface不知道做什么用,每增加个方法,Itest和ItestDisp都要添加。
5。就是Cotest类。。为什么还要在com里有这个类。调用CreateComObject和CreateRemoteComObject
这两个方法应该在客户端或外界使用嘛。在com里使用到了?