双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

看看这函数怎么调?我搞了好久,请高手帮忙,关于DLL函数的调用。

mgqmgq mgqmgq 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
VC中的声明
int ReadSrvReq(char* ctrlMsg, char* subCode,
char* contentMsg, int* msgLen,
int timeOut)
DELPHI中声明:
TReadSrvReq=function(ctrlMsg:Pchar;subCode:Pchar;contentMsg:Pchar; msgLen:integer;timeOut:integer):integer;stdcall;
调用:
mw:HWND;
mt:TCSGP_ReadConf;
mt1: TReadSrvReq;
a:integer;
st:string;
p:pchar;
ctrlMsg:string;
subCode:string;
contentMsg:string;
msgLen:integer;
time1:String;
mw:=loadlibrary('CSGPAPI_DLL.dll');
if mw<>0 then
try
mt1:=GetProcaddress(mw,'ReadSrvReq');

if assigned(mt1) then
a:=mt1(@ctrlMsg,@subCode,@contentMsg, msgLen,5);

finally
FreeLibrary(mw);
end;
到了这步a:=mt1(@ctrlMsg,@subCode,@contentMsg, msgLen,5);就出错了。

请问DLL函数应怎么声明,参数怎么传呢?
...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
mgqmgq
Delphi 5,944 成员 262,941 内容