求助老是这个错误“gethostbyname” : 不能将参数 1 从“CString”转换为“const char *” 你需要把UNICODE转换成ASCII.widechartomultibyte 或者其它转换函数 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 2. Unicode to ANSIstring UnicodeToANSI( const wstring& str ){ char* pElementText; int iTextLen; // wide char to multi char iTextLen = WideCharToMultiByte( CP_ACP, 0, str.c_str(), -1, NULL, 0,NULL, NULL ); pElementText = new char[iTextLen + 1]; memset( ( void* )pElementText, 0, sizeof( char ) * ( iTextLen + 1 ) ); ::WideCharToMultiByte( CP_ACP, 0, str.c_str(), -1, pElementText, iTextLen, NULL, NULL ); string strText; strText = pElementText; delete[] pElementText; return strText;}百度一下, 什么都有, 为什么要做伸手党呢 打开对话框 如何 置顶 vc,工控软件开发 工作机会 如何选择自定义树视图的多行?? 请问如何使对话框程序中的主菜单某项变灰或恢复? 封装了一个UDP,请各位大侠帮忙检测一下(Crying) 请大家进来看看 !!!! 200分求一小程序 一个简单的问题? 老问重提,请问如何调用蓝屏,不是自己画的,就像调用一种系统服务一样,可以吗,听说是藏在一个未公开的API中? 请问怎样正确显示鼠标的坐标?弄了半天 对话框怎么一运行就出错??! 静态文本 无法 添加 bn_clicked
string UnicodeToANSI( const wstring& str )
{
char* pElementText;
int iTextLen;
// wide char to multi char
iTextLen = WideCharToMultiByte( CP_ACP,
0,
str.c_str(),
-1,
NULL,
0,
NULL,
NULL );
pElementText = new char[iTextLen + 1];
memset( ( void* )pElementText, 0, sizeof( char ) * ( iTextLen + 1 ) );
::WideCharToMultiByte( CP_ACP,
0,
str.c_str(),
-1,
pElementText,
iTextLen,
NULL,
NULL );
string strText;
strText = pElementText;
delete[] pElementText;
return strText;
}百度一下, 什么都有, 为什么要做伸手党呢