-
-
[求助]VC6中ListCtrl控件SetItemText函数参数问题
-
发表于:
2012-5-5 16:50
21540
-
[求助]VC6中ListCtrl控件SetItemText函数参数问题
本人对VC不熟,学者做了一个抓包工具,可是编译总不对
申请变量
#define DEF_BUF_SIZE 2048
in_addr addr ;
WCHAR szTempBufW[DEF_BUF_SIZE] = {0} ;
通过抓包实现信息插入ListCtrl控件中,代码如下
addr.S_un.S_addr = lpPackInfo->nSourIp ;
MultiByteToWideChar (CP_ACP, 0, inet_ntoa(addr), -1, szTempBufW, sizeof(szTempBufW) );
this->m_PackList.SetItemText ( nCount, 3,
szTempBufW) ;//问题出现在这里
可是编译通不过error C2664: 'SetItemText' : cannot convert parameter 3 from 'unsigned short [2048]' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
我明明申请的szTempBufW看了是unsigned short 类型,函数SetItemText第3个参数类型说明也是unsigned short 类型,编译时为什么要为char*型才行?而且如果我修改强制转换类型话也不对(我要用来显示IP地址的,修改后就只有个位数了),事例上用的是VS2005可通过,用VC6怎么改?
PS:其他都对,94这个参数类型不对,伤脑筋!哪位大侠帮帮忙了!
[课程]Linux pwn 探索篇!