最近要調用C++的一個DLL文件,但其中的函數是用CHAR *定義的,我用DELPHI中的STRING定義,一直報錯或應返回值的函數不返回,請問大家原因,急等。。

解决方案 »

  1.   

    PChar; 可以地 你怎麼使用地那。
      

  2.   

    用delphi编写dll时,为了能让c++调用,所以涉及字符串的地方都必须用pchar,而不能用string.PChars are, with short strings, one of the original Object Pascal string types. They were created primarily as a C language and Windows API compatibility type.
      

  3.   

    C++ 中是DirectCommunicate(ID: integer;char *s, char*t)  最後一個*T是傳回指標我在DELPHI中 DirectCommunicate(ID: integer;s:pchar,var t:pchar)可是不行,不能傳回值:(,只傳回空格,可是就算我寫錯,也應傳送錯誤代碼啊