CInternetSession:加了头文件,怎么编译还会出错?

fzqrf 2008-07-31 11:25:15
#include <afxinet.h>
...
...
void CHTTPDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CInternetSession* pInternetSession;

}

程序编译时会出现如下错误:
Compiling...
HTTPDlg.cpp
D:\VCProj\HTTP\HTTPDlg.cpp(178) : error C2065: 'CInternetSession' : undeclared identifier
D:\VCProj\HTTP\HTTPDlg.cpp(178) : error C2065: 'pInternetSession' : undeclared identifier
D:\VCProj\HTTP\HTTPDlg.cpp(178) : warning C4552: '*' : operator has no effect; expected operator with side-effect
Error executing cl.exe.

HTTPDlg.obj - 2 error(s), 1 warning(s)

请问是什么原因?谢谢!
...全文
824 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
my_heaven 2009-07-09
  • 打赏
  • 举报
回复
还少头文件
WinSock2.h
atlconv.h
xkyx_cn 2008-07-31
  • 打赏
  • 举报
回复
我把#include <afxinet.h>放在.cpp的开头里编译没问题
xkyx_cn 2008-07-31
  • 打赏
  • 举报
回复
看一下你的代码
fzqrf 2008-07-31
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 xkyx_cn 的回复:]
我把#include <afxinet.h>放在.cpp的开头里编译没问题
[/Quote]
我就是放在.cpp的开头,编译出错啊!

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧