VS2005创建的ATL service(exe)中如何使用MFC

hhh_hao 2010-02-22 12:15:13
使用VS2005向导创建了一个ATL service(exe)项目,
并设置为"Use MFC in a Static Library", 在stdafx.h中加入头文件#include <afxwin.h>,
编译出错,
1>e:\windowsservice\test\test.cpp(10) : error C2504: 'CAtlServiceModuleT' : base class undefined
1>e:\windowsservice\test\test.cpp(10) : error C2143: syntax error : missing ',' before '<'
1>e:\windowsservice\test\test.cpp(35) : error C2039: 'WinMain' : is not a member of 'CtestModule'


有人知道,要如何设置吗?网上找到的一些都是vc6.0相关的.
另外,我想将一个MFC程序改为Windows Service, 有什么好的办法吗?
...全文
283 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
aosoft2010 2010-03-04
  • 打赏
  • 举报
回复
遇到同样的问题,苦恼中。
xsc2001 2010-02-22
  • 打赏
  • 举报
回复
windows服务程序和ATL service没关系呀,ATL service是创建COM程序,即单独可运行,也可以由其他程序调用的程序。
至于windows服务程序的开发给你一个资料看吧,上面写的很详细:
http://www.vckbase.com/document/viewdoc/?id=1677
ljz888666555 2010-02-22
  • 打赏
  • 举报
回复
MFC跟ATL有可能冲突,我搜集的几个ATL服务开发例子http://blog.csdn.net/ljz888666555/archive/2009/11/06/4777331.aspx

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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