W
wangmao
Unregistered / Unconfirmed
GUEST, unregistred user!
我在dll中用zconnection控件来配置数据库连接信息代码如下:library ZconQuery;uses ShareMem,SysUtils,Variants,Classes,Graphics,Controls,Windows,Messages, Forms,Dialogs,ZConnection, ZAbstractRODataset, ZAbstractDataset, ZDataset;type CDArr = array[0..3] of string; //公共参数数据库读取{$R *.res}procedure ZconCon(Zcon:TZConnection;Arr: CDArr); cdecl;begin Zcon.Database := Arr[0]; Zcon.HostName := Arr[1]; Zcon.User := Arr[2]; Zcon.Password := Arr[3]; Zcon.Protocol := 'postgresql-8'; Zcon.Properties.Add('character_set_client=gbk'); Zcon.Properties.Add('character_set_connection=gbk'); Zcon.Properties.Add('character_set_database=gbk'); Zcon.Properties.Add('character_set_results=gbk'); Zcon.Properties.Add('character_set_server=gbk'); Zcon.Properties.Add('character_set_system=gbk'); Zcon.Properties.Add('collation_connection=gbk_chinese_ci'); Zcon.Properties.Add('collation_database=gbk_chinese_ci'); Zcon.Properties.Add('collation_server=gbk_chinese_ci'); Zcon.Properties.Add('Codepage=gbk');end;exports ZconCon;beginend.但是我在主程序调用的时候(主程序也加入sharemen)执行查询后,关闭窗体后出现invalid pointer operation如果我把那动态库中的过程直接写到主程序中,就没有这个问题主程序中不用引用sharemen这个单元(对直接写在主程序时,加上sharemen就提示指针错)