大哥!! 大姐 !
小弟我 有 的 调用外部DLL 的 一个 方法 不知道 如何接收 例子:[DLLImport("ABCD.dll")]
public static unsafe extern int Read(char* asd) 注意 这个 asd 是 输出的 返回的 是 ‘|’分开的 字符串
如何接收 他
我是 char [] a=new char[1000];fixed (char* cc=&a[0])
{
Read(cc);
}
得到的 是 乱码 !! 不知道为什么??能告诉我吗 ??
小弟我 有 的 调用外部DLL 的 一个 方法 不知道 如何接收 例子:[DLLImport("ABCD.dll")]
public static unsafe extern int Read(char* asd) 注意 这个 asd 是 输出的 返回的 是 ‘|’分开的 字符串
如何接收 他
我是 char [] a=new char[1000];fixed (char* cc=&a[0])
{
Read(cc);
}
得到的 是 乱码 !! 不知道为什么??能告诉我吗 ??
[DllImport("ABCD.dll", CharSet=CharSet.Ansi)]
public static extern int Read(StringBuilder asd);//...{
StringBuilder asd = new StringBuilder(10 * 1024); // 你们约定的大小
string[] toks = asd.ToString().Split('|');
}
{
StringBuilder asd = new StringBuilder( 1024 ); // 你们约定的大小
Read( asd );
string[] toks = asd.ToString().Split('|');
}
给我 的 文档中 参数是 Char* 能用 别的 类型代替吗 ??