摘要:
环境:VS20101.CString to char*第一种方法:需头文件:atlconv.h CString host_string; //CString to char* USES_CONVERSION; char *ipaddress = T2A(host_string);此方法消耗栈空间,适合少量使用。第二种方法:int My_WcharToChar(char* pDest,CString& pSource){ wchar_t* pawstr = NULL; pawstr = pSource.GetBuffer(pSource.GetLength()+... 阅读全文
摘要:
1.环境:vs2010 & 默认项目字符集(貌似是unicode)2.首先为ip address control添加control类型变量m_ipaddressedit, BYTE ips[4]; CString host_string; m_ipaddressedit.GetAddress(ips[0],ips[1],ips[2],ips[3]); //读取IP //int GetAddress( BYTE& nField0, BYTE& nField1, BYTE& nField2, BYTE& nField3 ... 阅读全文