Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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".

C++
class CMyDlg: 
	public CAxDialogImpl<CTestDialog>


After initialized

C++
CMyDlg dlg;
dlg.DoModal();


It just hang on every thing.

Then I changed another method

C++
CMyDlg dlg;
dlg.Create(NULL);
dlg.ShowWindow(SW_SHOW);


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
Posted
Comments
armagedescu 17-Sep-12 9:56am    
how can you call doModal on a hidden box?

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.
 
Share this answer
 
Comments
xchftt 16-Sep-12 7:53am    
THe create function parameter was hWnd. Because my application was a ALT service, no window existed.
skydger 17-Sep-12 5:08am    
Have you tried to create standard CDialog window?
Although it might be a problem. If there is no any window, you can try to attach your dialog to desktop:
CWnd wnd;
wnd.Attach( GetDesktopWindow() );
CDialog dlg;
dlg.Create( MAKEINTRESOURCE(IDC_MY_DIALOG), &wnd);
...
wnd.Detach();
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900