如何将char型转化为cstring型?? char str[]="Hello";char *p="Hello";CString s;s=p;s=str; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不行 我有以下代码: char cTemp=iTemp;///iTemp=43 CString strTemp=cTemp; MessageBox(strTemp);现实的字符是“?”为什么?? char str[]="str";CString cstr;cstr.Format("%s",str); 我说的不是char*也不是char[];而是char型 iTemp是从钩子得到的按键信息他的值是nCodeBOOL CFastEditorDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct) { int iTemp=(int)pCopyDataStruct->lpData; char cTemp=iTemp; CString strTemp=cTemp; MessageBox(strTemp); return CDialog::OnCopyData(pWnd, pCopyDataStruct);}显示的字符是“?” char ?char c='e';CString show="";show.Insert(0,c);虽然表面上是个Insert,但实际上也是一种转化。 char c;CString strconver;strconvert.Format("%c", c); 你还是检查一下你的pCopyDataStruct->lpData;是不是能够表示的ASC字符吧。你的做法没有错误,除了MessageBox()函数少参数外。 char cTemp=iTemp;///iTemp=43CString strTemp(cTemp);很easy啊!! char cTemp=iTemp;///iTemp=43CString strTemp="";strTemp+=iTemp; MessageBox(strTemp); C如何创建一个线程 vc2008的MSDN不太好用呀!? 一个很弱智的问题 请教关于GetProcAddress()总是返回NULL的问题 帮看调用GetPrivateProfileString的问题? CStatic类中关于Create函数的一个疑问 dll里虚函数的问题请教100分 呵呵,猜一猜~~~~~~~~~~~~~ VC或者BC学得好的,英语都很好 哪位大虾帮帮忙 经典的VC++ SDK 编译问题 请问怎样获得光盘的序列号,以及光盘的卷标,谢谢
char cTemp=iTemp;///iTemp=43
CString strTemp=cTemp;
MessageBox(strTemp);
现实的字符是“?”
为什么??
CString cstr;cstr.Format("%s",str);
BOOL CFastEditorDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
int iTemp=(int)pCopyDataStruct->lpData;
char cTemp=iTemp;
CString strTemp=cTemp;
MessageBox(strTemp);
return CDialog::OnCopyData(pWnd, pCopyDataStruct);
}
显示的字符是“?”
CString show="";
show.Insert(0,c);虽然表面上是个Insert,但实际上也是一种转化。
CString strconver;
strconvert.Format("%c", c);
你的做法没有错误,除了MessageBox()函数少参数外。
CString strTemp(cTemp);很easy啊!!
CString strTemp="";
strTemp+=iTemp;
MessageBox(strTemp);