接到一個項(xiàng)目,對方提供了一個dll和動態(tài)庫函數(shù)說明文檔,文檔內(nèi)的 參數(shù)類型為string ,請問下各位。string 類型對應(yīng)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 動態(tài)庫函數(shù)function ic_test(port: integer;
userid: string;
): integer;stdcall; 幫幫忙啊
1 回答

紫衣仙女
TA貢獻(xiàn)1839條經(jīng)驗(yàn) 獲得超15個贊
試過C# C++ Delphi 最終還是一樣的問題,返回值為類型錯誤,可能并不是類型問題,而是動態(tài)庫本身問題了。結(jié)帖了
- 1 回答
- 0 關(guān)注
- 986 瀏覽
添加回答
舉報
0/150
提交
取消