土
土拨鼠
Unregistered / Unconfirmed
GUEST, unregistred user!
我的dll文件代码如下
library sql_sele;
uses
ShareMem,
SysUtils,
Classes,DBTables;
{$R *.res}
procedure Filter_All(tb:TTable;str:string);stdcall;
begin
if not tb.Active then
tb.Open;
tb.Filter:=str;
tb.Filtered:=true;
end;
exports
Filter_All index 0;
begin
end.
在工程中的程序如下:
procedure TForm1.Button1Click(Sender: TObject);
var str:string;
begin
str:='U_user_id=''' + trim(edit_gh.Text) +
''' and U_password=''' + trim(edit_mm.Text) + '''';
theHandle:=LoadLibrary(’dll/sql_sele.dll’);
if theHandle <> 0 then
begin
@Filter_All:= GetProcAddress(theHandle,’Filter_All’);
if (@Filter_All) <> nil then
begin
??? TFilter_All(tb_czy,str);
FreeLibrary(theHandle);
end;
end
else
MessageBox(0,’指定的动态链接库可能不存在’,’信息’,
MB_OK+MB_ICONWARNING);
end
else
MessageBox(Form1.Handle,’请指定一个计算方法。’,’警告’,
MB_OK+MB_ICONWARNING);
end;
可是在程序运行时,总是在TFilter_All(Filter_All)处出错,
我想我这句程序一定写的有问题,还望高手指点,小弟在此先谢过了!
library sql_sele;
uses
ShareMem,
SysUtils,
Classes,DBTables;
{$R *.res}
procedure Filter_All(tb:TTable;str:string);stdcall;
begin
if not tb.Active then
tb.Open;
tb.Filter:=str;
tb.Filtered:=true;
end;
exports
Filter_All index 0;
begin
end.
在工程中的程序如下:
procedure TForm1.Button1Click(Sender: TObject);
var str:string;
begin
str:='U_user_id=''' + trim(edit_gh.Text) +
''' and U_password=''' + trim(edit_mm.Text) + '''';
theHandle:=LoadLibrary(’dll/sql_sele.dll’);
if theHandle <> 0 then
begin
@Filter_All:= GetProcAddress(theHandle,’Filter_All’);
if (@Filter_All) <> nil then
begin
??? TFilter_All(tb_czy,str);
FreeLibrary(theHandle);
end;
end
else
MessageBox(0,’指定的动态链接库可能不存在’,’信息’,
MB_OK+MB_ICONWARNING);
end
else
MessageBox(Form1.Handle,’请指定一个计算方法。’,’警告’,
MB_OK+MB_ICONWARNING);
end;
可是在程序运行时,总是在TFilter_All(Filter_All)处出错,
我想我这句程序一定写的有问题,还望高手指点,小弟在此先谢过了!