代码如下:
unit RDM;{$WARN SYMBOL_PLATFORM OFF}interfaceuses
Windows, Messages, SysUtils, Classes, ComServ, ComObj, VCLCom, DataBkr,
DBClient, GP50Server_TLB, StdVcl, DBTables, Provider, DB;type
TGP50RDM = class(TRemoteDataModule, IGP50RDM)
...
private
{ Private declarations }
protected
class procedure UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); override;
public
{ Public declarations }
//第一种:按照系统的原型或不带参数:
//编译时[Error] RDM.pas(205): Declaration of 'Create' differs from previous declaration //好像说的意思是:"说明与先前的说明不同"
Constructor Create(ComServer:TComServerObject;CompentClass:TComponentClass;Const ClassID:TGUID;Instancing:TClassInstancing;ThreadingModel:TThreadingModel); override;
Constructor Create();override;
//第二种:
//编译时:[Error] Main.pas(16): Unsatisfied forward or external declaration: 'TForm1.create'//好像说的意思是:"不满足的向前或外部说明"
constructor create(TOwner:TComponent);override; end;...
implementation{$R *.DFM}....
initialization
//--定义的原型:--加入Remote date module时,系统自动创建的,只不过我把它贴出来{
TComponentFactory.Create:proceduce
(ComServer:TComServerObject;CompentClass:TComponentClass;
Const ClassID:TGUID;Instancing:TClassInstancing;ThreadingModel:TThreadingModel=tmSingle);
}
//--加入Remote date module时,系统自动创建的
TComponentFactory.Create(ComServer, TGP50RDM,
Class_GP50RDM, ciMultiInstance, tmApartment);
end.说明:我想要的结果是调用Remote data module模块时.通过构造器来实现读取ini配置文件.ini文件中存有数据库登陆名和密码.
不知道这样子实现有没有问题,或者是有更好的方法,请各位指点指点...
unit RDM;{$WARN SYMBOL_PLATFORM OFF}interfaceuses
Windows, Messages, SysUtils, Classes, ComServ, ComObj, VCLCom, DataBkr,
DBClient, GP50Server_TLB, StdVcl, DBTables, Provider, DB;type
TGP50RDM = class(TRemoteDataModule, IGP50RDM)
...
private
{ Private declarations }
protected
class procedure UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); override;
public
{ Public declarations }
//第一种:按照系统的原型或不带参数:
//编译时[Error] RDM.pas(205): Declaration of 'Create' differs from previous declaration //好像说的意思是:"说明与先前的说明不同"
Constructor Create(ComServer:TComServerObject;CompentClass:TComponentClass;Const ClassID:TGUID;Instancing:TClassInstancing;ThreadingModel:TThreadingModel); override;
Constructor Create();override;
//第二种:
//编译时:[Error] Main.pas(16): Unsatisfied forward or external declaration: 'TForm1.create'//好像说的意思是:"不满足的向前或外部说明"
constructor create(TOwner:TComponent);override; end;...
implementation{$R *.DFM}....
initialization
//--定义的原型:--加入Remote date module时,系统自动创建的,只不过我把它贴出来{
TComponentFactory.Create:proceduce
(ComServer:TComServerObject;CompentClass:TComponentClass;
Const ClassID:TGUID;Instancing:TClassInstancing;ThreadingModel:TThreadingModel=tmSingle);
}
//--加入Remote date module时,系统自动创建的
TComponentFactory.Create(ComServer, TGP50RDM,
Class_GP50RDM, ciMultiInstance, tmApartment);
end.说明:我想要的结果是调用Remote data module模块时.通过构造器来实现读取ini配置文件.ini文件中存有数据库登陆名和密码.
不知道这样子实现有没有问题,或者是有更好的方法,请各位指点指点...
解决方案 »
- 一个关于防止文件拷贝的问题,有点挑战性,高手进来看看。
- 服务器IndyServer端转发多个IndyClient发送过来的消息到另外的IndyClient怎么处理?d2007
- ADO連不上SQL SERVER 出現錯誤[DBMSRPCN]一般性网络错误。请检查网络文档
- 给喜欢钻研的人看看,在创建对象的时候做了什么!
- 如何实现如下的功能呢?使用消息方式。
- 请问怎样将三个变量用SQL语句分别存入指定*.DB表的字段中?
- 请教:在WORD中插入表格的问题!
- 请教高手:
- 如何比较时间?
- 怎样把自已的程序放到任务栏??????
- 我想用Delphi写一个邮件收发组件的DLL,请教一些。
- bde连接数据库时的问题
而且我也试过用onCreate,onDestroy事件来处理,不知道效果是一样的不?
在这个试的过程遇到过一个问题是:
ExtractFilePath(Application.ExeName)来获取路径时,一放在Remote data modul这个onCreate,onDestroy事件中Application根本没有ExeName这个属性,在Form窗体中是可以的.