void GetString(CPtrArray *DnsStr,CString str)
{
int num = 0;
int oldnum = 0;
int len = str.GetLength();
int i = 0;
while(1)
{
num = str.Find(",",oldnum+1);
if(i == 0)
DnsStr.add(str.Mid(oldnum,num-oldnum));
else
if(num == -1)
DnsStr.add(str.Mid(oldnum+1,len-oldnum));
else
DnsStr.add(str.Mid(oldnum+1,num-oldnum-1));
// MessageBox(NULL,str,NULL,MB_OK);
oldnum = num;
i ++;
if(num == -1)
return;
}
}这里的DnsStr.add会出错,是不是我用错了,还是怎么回事?
--------------------Configuration: MagMsg - Win32 Debug--------------------
Compiling...
MagMsgDlg.cpp
e:\share\magmsg\debug\msado15.tlh(407) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
E:\share\MagMsg\MagMsgDlg.cpp(196) : error C2228: left of '.add' must have class/struct/union type
E:\share\MagMsg\MagMsgDlg.cpp(199) : error C2228: left of '.add' must have class/struct/union type
E:\share\MagMsg\MagMsgDlg.cpp(201) : error C2228: left of '.add' must have class/struct/union type
Error executing cl.exe.MagMsg.exe - 3 error(s), 1 warning(s)
{
int num = 0;
int oldnum = 0;
int len = str.GetLength();
int i = 0;
while(1)
{
num = str.Find(",",oldnum+1);
if(i == 0)
DnsStr.add(str.Mid(oldnum,num-oldnum));
else
if(num == -1)
DnsStr.add(str.Mid(oldnum+1,len-oldnum));
else
DnsStr.add(str.Mid(oldnum+1,num-oldnum-1));
// MessageBox(NULL,str,NULL,MB_OK);
oldnum = num;
i ++;
if(num == -1)
return;
}
}这里的DnsStr.add会出错,是不是我用错了,还是怎么回事?
--------------------Configuration: MagMsg - Win32 Debug--------------------
Compiling...
MagMsgDlg.cpp
e:\share\magmsg\debug\msado15.tlh(407) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
E:\share\MagMsg\MagMsgDlg.cpp(196) : error C2228: left of '.add' must have class/struct/union type
E:\share\MagMsg\MagMsgDlg.cpp(199) : error C2228: left of '.add' must have class/struct/union type
E:\share\MagMsg\MagMsgDlg.cpp(201) : error C2228: left of '.add' must have class/struct/union type
Error executing cl.exe.MagMsg.exe - 3 error(s), 1 warning(s)
解决方案 »
- 在CStatic上动态创建button的消息响应
- 我用::ioctlsocket函数如果得到缓冲区字节数为0是否就可以判定socket断开?
- 如何得到一个字符串的2进制表示呢??
- MagicCollector(文档收集精灵) v1.0.0.0 今天发布了
- 能不能将SCROLLBAR 的滑块用一个图片来代替?
- 关于文件夹的问题
- [紧急求助]谁能提供给小弟一份BMP转成JPG的源码,万分感谢!!!
- 如何使用VC++2005 ListControl控件实现读取一个txt文件
- 10分买一条语句,太容易赚了,能者请进!!!
- delete问题
- 哪有有关recv()的拦截资料....
- 请给些文件操作方面的建议
c:\program files\microsoft visual studio\vc98\mfc\include\afxcoll.h(355) : see declaration of 'CPtrArray'