MFC App fails trying to display a dialog cont
Hi all,
I am working on a dialog-based MFC application, which consists of multiple property pages. From one of the property pages, I am trying to launch a dialog box which contains an ActiveX control.
This is currently not working and the application exits with an access violation error when I call DoModal for the dialog. On debugging, I see this is due to AfxGetThread() returning NULL in AfxOleInit(). A subsequent statement in AfxOleInit() tries to dereference this NULL pointer. This does not happen if I launch the dialog-box from the application's InitInstance() function instead of a property page or if I add the control to the property page itself. I have made sure that the control is registered and that I call AfxEnableControlContainer() from the application's InitInstance() function.
I am using Visual Studio C++ .NET.
Is there something else that I have missed? Any help is greatly appreciated.
Thanks,
Priya
|