COM服务器无法显示对话框? [英] COM server can't show dialog?
问题描述
我是COM的初学者。目前我正在尝试编写COM服务器(* .EXE)来接收来自其他进程的消息。所以,我打算为我的COM服务器创建一个隐藏的对话框。
我刚用VS2010和Add class wizzard创建了一个ATL Dialog类。
I am beginner with COM. Currently I am trying to write a COM server(*.EXE) to receive messages from other process. So, I plan to create a hidden dialog for my COM server.
I just created a ATL Dialog class using VS2010 and the "Add class wizzard".
class CMyDlg:
public CAxDialogImpl<CTestDialog>
初始化后
After initialized
CMyDlg dlg;
dlg.DoModal();
它只是挂在每件东西上。
然后我改变了另一种方法
It just hang on every thing.
Then I changed another method
CMyDlg dlg;
dlg.Create(NULL);
dlg.ShowWindow(SW_SHOW);
什么都没发生!只是一个错误代码:1813。这意味着在图像文件中找不到指定的资源类型。
我无法理解为什么会发生这种情况?
Dialog资源是由wizzard创建的。
我从Google和一些论坛搜索了整整2天,没有找到任何内容。
你能告诉我一些意见吗?
谢谢!
戈登
Nothing happened! Just an error code: 1813. That means The specified resource type cannot be found in the image file.
I can't understand why this happen?
The Dialog resource was created by the wizzard.
I searched from google and some forum for the whole 2 day, nothing was found.
Could you please give me some idea?
Thanks!
Gordon
推荐答案
这可能是Create方法中的一个问题:您应该使用模板名称,而不是NULL语句。如果您没有派生'Create'虚拟方法,我想,编译器将使用标准的CDialog模板,而不是继承的模板。
It might be a problem in Create method: you should use a template name, not a NULL statement. If you did not derived 'Create' virtual method, I suppose, the compiller will use standard CDialog template, not the inherited one.
我忽略了我的操作系统是Windows7。如果成功创建,服务对话框将在会话0中起作用。在此会话中,任何消息都不能从其他会话到达。
I ignored that my OS was Windows7. The services dialog, if successfully created, would work at Session 0. In this Session, no message can arrive from other session.
这篇关于COM服务器无法显示对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!