[求助]:倾尽所有积分,只为求一答案!!(26分)

Y

ydzi_

Unregistered / Unconfirmed
GUEST, unregistred user!
String StrMsg;
wchar_t * pMsgBuff;
longint msglen;
msglen = StrMsg.WideCharBufsize();
pMsgBuff = (wchar_t *)malloc(msglen*2+10);
StrMsg.WideChar(pMsgBuff, msglen);
free(pMsgBuff);
以上代码用DELPHI应该怎么写啊??!!谢谢,只有这么点点分数了……
 
type
pMsgBuff=^wchar_t;
wchar_t=record
var
StrMSG:String;
msglen:integer;
begin
msglen := StrMsg.WideCharBufsize();
pMsgBuff := New(pMsgBuff);
StrMsg.WideChar(pMsgBuff, msglen);
DisPose(pMsgBuff);
end;

你的代码里边还缺少 wchar_t 这个结构的定义
 
.......
wchar_t 这个好像是cbuilder系统类型吧!
对应DELPHI应该是什么类型啊??!!
 
wchar_t == word
 
WideCharBufsize??
这个是什么意思啊??!!
 
wchar_t 可能是 WideChar Unicode字符
 
StrMsg.WideChar(pMsgBuff, msglen);
StrMsg是string类型,好像不能这么用,可以用下面函数转换
function StringToWideChar(const Source: string;
Dest: PWideChar;
DestSize: Integer): PWideChar;
 
搞清楚需要,找到另种解决方法!!
结贴,不过这个问题还是没搞清楚!
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
707
import
I
I
回复
0
查看
730
import
I
I
回复
0
查看
573
import
I
顶部