type
TMyRemoteDataModule = class(TRemoteDataModule, IMyRemoteDataModule)
private
{ Private declarations }
protected
class procedure UpdateRegistry(Register: Boolean;
const ClassID, ProgID: string);
override;
public
constructor Create(AOwner: TComponent);
override;
// 加一个构造器
destructor Destroy;
override;
// 增加
{ Public declarations }
end;
var
MyRemoteDataModule: TMyRemoteDataModule;
// 增加
implementation
// 增加
constructor TMyRemoteDataModule.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
MyRemoteDataModule := self;
end;
// 增加
destructor TMyRemoteDataModule.Destroy;
begin
MyRemoteDataModule := nil;
inherited Destroy;
end;
initialization
MyRemoteDataModule := nil;
// 增加
TComponentFactory.Create(ComServer, TMyRemoteDataModule,
Class_MyRemoteDataModule, ciMultiInstance, tmApartment);
end.
主窗体中引用该.pas文件,即可用MyRemoteDataModule操作其中的方法、变量.
如:
if MyRemoteDataModule <> nil then
MyRemoteDataModule. ...;