请问如何把 query 当成参数传递给 dll 中的某一函数昵?具体该怎么写呀???? 1、请问如何把 query 当成参数传递给 dll 中的某一函数昵?具体该怎么写呀????2、当dll中的函数执行某一查询,如何将查询结果返回给昵?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 建议楼主改变这种方法因为使用ADO的几个类当作dll参数传递时,在程序退出时会出现资源释放的错误。一定可以使用其它方法替代。 不要把对象直接传给DLL,而要把对象及其操作包装成普通函数和指针再传递给DLL,就像windows API那样,否则你的程序会死的很残 要把对象直接传给DLL,而要把对象及其操作包装成普通函数和指针再传递给DLL,就像windows API那样,请问具体该怎么作能否给一段例码 function OpenSQL(SQL: pchar): pointer;stdcall;var qry: TQuery;begin qry := TQuery.Create(...); qry.SQL.Text := SQL; qry.Open; Result := qry;end;typeRQueryOprs = record function OpenSQL(SQL: pchar): pointer;stdcall; function ExecSQL(SQL: pchar): integer;stdcall; function Eof(Query: pointer): boolean;stdcall; ....end;PQueryOprs =^RQueryOprs;const query_oprs: RQueryOprs = ( OpenSQL: thispage.OpenSQL; ExecSQL: thispage.ExecSQL; Eof: thispage.Eof; .... );将query_oprs的地址传入DLL即可,DLL可以通过函数表操作任何类型的SQL数据库为方便使用可以在DLL中将函数表包装成类 java 用Jfreechat做如何做动态仿cup图? delphi Timage控件的问题 如何检测某个程序特定事件发生? 关于accees存储图片的问题 StringGrid的颜色显示 怎样编写一个socks5代理服务器? 免费iso软件下载站 有谁对developer express组件熟悉呀? 导数据问题 谁做过server端是delphi而client端是VC程序的DCOM/COM+远程服务器程序? mouse_event可以模拟鼠标向左移动和向上移动吗? 怎么样在数删除一个表,在线结!
请问具体该怎么作
能否给一段例码
var
qry: TQuery;
begin
qry := TQuery.Create(...);
qry.SQL.Text := SQL;
qry.Open;
Result := qry;
end;type
RQueryOprs = record
function OpenSQL(SQL: pchar): pointer;stdcall;
function ExecSQL(SQL: pchar): integer;stdcall;
function Eof(Query: pointer): boolean;stdcall;
....
end;
PQueryOprs =^RQueryOprs;const
query_oprs: RQueryOprs = (
OpenSQL: thispage.OpenSQL;
ExecSQL: thispage.ExecSQL;
Eof: thispage.Eof;
....
);将query_oprs的地址传入DLL即可,DLL可以通过函数表操作任何类型的SQL数据库
为方便使用可以在DLL中将函数表包装成类