HELP: activex control in dialog box in mfc user dll (dialog not launching) 
Author Message
 HELP: activex control in dialog box in mfc user dll (dialog not launching)

have developed MFC user dll statically linked to mfc.  the dll is a dialog
box which is a container for a mschart ocx object.
although the dll export function which launches the dialog box (DoModal())
works fine without the ocx, when the ocx is included, the dialog box will
not initialize.  there are no error messages.  Debugging reveals that it is
bombing in the createdialogindirect (mfc) function.  for some reason, the
m_nflags variable is set to 256 after the windows createdialogindirect is
called.  This causes the mfc function to return false.

again, NO ERROR or WINDOW is created.  the dll is loaded from a dialog-based
mfc app.  Is there something i have not included in the dll which is
required for the ocx control?



Sun, 23 Dec 2001 03:00:00 GMT  
 HELP: activex control in dialog box in mfc user dll (dialog not launching)

Quote:
>although the dll export function which launches the dialog box (DoModal())
>works fine without the ocx, when the ocx is included, the dialog box will
>not initialize.

Bill,

Here's what I found I had to do in an experiment with AX controls in
dialogs in a DLL:

extern "C" __declspec(dllexport) BOOL Pascal ExportedFunction()
{
        AFX_MANAGE_STATE(AfxGetStaticModuleState());

        ::OleInitialize(NULL);

        AfxEnableControlContainer();

        CCalDlg dlg;

        dlg.DoModal();

        ::OleUninitialize();

        return true;

Quote:
}

Dave
----
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.


Mon, 24 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Launching dialog box with ActiveX Control...

2. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

3. Getting events from an ActiveX control not in a dialog box

4. Cannot add an ActiveX control to a DLL dialog box

5. ActiveX control from dialog box in DLL?

6. Cannot add an ActiveX control to a DLL dialog box

7. User Controls in a dialog in a 16-bit MFC extension DLL

8. Active X control not displayed in a modal dialog box in a dll

9. COM Dll with MFC Dialog containing an ActiveX Control

10. Creating ActiveX control in an MFC dialog in a DLL

11. ActiveX control in MFC .dll Dialog.

12. HELP! ActiveX controls in dialog box

 

 
Powered by phpBB® Forum Software