积极答复者
VS2008 ATL 创建的Windows服务中使用MessageBox

问题
-
过程如下:
1.创建一个ATL的Windows服务。
2. 仅仅写一个MessageBox。
extern "C" int WINAPI _tWinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/,
LPTSTR /*lpCmdLine*/, int nShowCmd)
{
MessageBox(NULL,L"T",L"T",0);
return _AtlModule.WinMain(nShowCmd);
}
现象,程序退出时在显示输出窗口中输出,其中0x100109da 部分会随机变化
XX.exe 中的 0x100109da 处最可能的异常: 0xC0000005: 读取位置 0x00000000 时发生访问冲突
有什么解释吗?
答案
-
服务里面显示MessageBox?有谁会去点“确定”?
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
Visual C++ MVP- 已建议为答案 Nancy Shao 2009年12月9日 12:39
- 已标记为答案 Nancy Shao 2009年12月11日 8:13
全部回复
-
服务里面显示MessageBox?有谁会去点“确定”?
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
Visual C++ MVP- 已建议为答案 Nancy Shao 2009年12月9日 12:39
- 已标记为答案 Nancy Shao 2009年12月11日 8:13
-
你可以在调试器中运行服务,然后用outputdebugstring输出调试信息,或者写系统的事件日志
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP