ITPub博客

首页 > 应用开发 > > C++ 调用 Delphi Dll

C++ 调用 Delphi Dll

作者:markriver 时间:2019-08-15 10:37:30 0 删除 编辑

接到一个项目,对方提供了一个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;


 帮帮忙啊

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/818/viewspace-3151437/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2020-07-03

  • 博文量
    502
  • 访问量
    18493