For Programmers: Free Programming Magazines  


Home > Archive > VC Language > November 2005 > ActiveX controls in MFC DLLs Dialog (solution worth mensioning)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ActiveX controls in MFC DLLs Dialog (solution worth mensioning)
Dpak

2005-11-24, 7:01 pm

Hi NewBies,

I had a crash in winocc.cpp line 301 when trying to add DLL to a
MFC ATL dialog and call from a CView App. After 100 trials my friend
poped me a suggestion worth a ton of Gold !

To prevent crash in DLL when hosting an activex contrl inside a MFC DLL
dialog

Ensure the following

In InitInstance of the DLL App class
Have AfxEnableControlContainer() as the first line;

In your calling applications view invoke the DLL as
CoInitializeEx(NULL, COINIT_MULTITHREADED);

I had it working but any ideas of why it is working ? Experts please
help !

Thanks
Deepak

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com