Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using vs 2008 .

I created the service project (ATL).
After that using add resouce i have add the Dialog box in my application.
Then i used following code to launch that dialog box but its leads to program crashing..

C#
int launchTest()
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());

  // TODO: Add your implementation code here
  MyDialog dlg;

  dlg.DoModal();
  return 1;
}



MyDialog is my class name..
Posted
Updated 18-Nov-13 21:42pm
v2
Comments
chandanadhikari 19-Nov-13 5:27am    
hi,what error messages are you getting when it crashes. Or check the events log to see what message is logged there.It might be some pointer issue. Either you need to debug your code or collect a crash dump and perform post mortem analysis.
@BangIndia 19-Nov-13 5:48am    
Here my exe is getting crashed.

_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle()
{ ASSERT(afxCurrentResourceHandle != NULL);
return afxCurrentResourceHandle; }
chandanadhikari 19-Nov-13 6:04am    
so you are not getting the pointer to this new resource properly. make sure you have included the files which have code for your dialog box. Ideally, the ATL Dialog Wizard implements a dialog box derived from CAxDialogImpl. This class includes support for hosting ActiveX and Windows controls.Later you can replace all instances of CAxDialogImpl with either CSimpleDialog or CDialogImpl as your base class.
Do you not get any errors\warnings while building the project ? Also maybe the resource is not getting initialized properly .
@BangIndia 19-Nov-13 7:06am    
NO i didn't get any error .
do u have any examples of Dialog box integration with ATL project?
chandanadhikari 19-Nov-13 8:02am    
see if this helps in any way
http://msdn.microsoft.com/en-us/library/vstudio/b3c267wx%28v=vs.90%29.aspx
if it works then it might help you understand what was going wrong

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