为了账号安全,请及时绑定邮箱和手机立即绑定

C++ 调用 Delphi Dll

C++ 调用 Delphi Dll

C++
弑天下 2018-07-31 10:09:24
接到一个项目,对方提供了一个dll和动态库函数说明文档,文档内的 参数类型为string ,请问下各位。string 类型对应C++ 什么类型啊,char wchar_t 等都试过了不对。C++代码typedef int (WINAPI *tool)(int port,const wchar_t *userid[]);     HMODULE hDLL = LoadLibrary(L"IcCard.dll");      if(hDLL != NULL)       {           tool too = tool(GetProcAddress(hDLL, "ic_test"));            if(too != NULL)           {               const wchar_t  * userid = L"123456";            //char userid[] = "123456";             int ss = too(1,&userid);             printf("%d",ss);             }     }Delphi 动态库函数function ic_test(port: integer;  userid: string;  ): integer;stdcall; 帮帮忙啊
查看完整描述

1 回答

?
紫衣仙女

TA贡献1839条经验 获得超15个赞

试过C# C++ Delphi 最终还是一样的问题,返回值为类型错误,可能并不是类型问题,而是动态库本身问题了。结帖了


查看完整回答
反对 回复 2018-08-21
  • 1 回答
  • 0 关注
  • 874 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信