
Show modeless form in VB ActiveX DLL from C++ MFC DLL
We have a VB ActiveX DLL that we are trying to load from a Visual C++ 5.0
MFC DLL. The VB DLL has a class that loads a modeless form. We used the
Class Wizard to create a wrapper class for the VB class, derived from
COleDispatchDriver. We initialize the COM library with CoInitialize(NULL),
create an instance of the class, and call the class method (VB procedure)
that loads the form.
This works fine when the method loads a modal form. But it throws an
exception when loaded non-modally. "Float Inexact Result" is displayed for
the exception in the Visual Studio 97 debug window after the call
SCODE sc = m_lpDispatch->Invoke(dwDispID, IID_NULL, 0, wFlags, &dispparams,
pvarResult, &excepInfo, &nArgErr);
I've tested this using an MFC executable and get the same exception but also
get a dialog box with the message, "Non-modal forms cannot be displayed in
this host application from an ActiveX DLL, ActiveX Control, or Property
Page.
Is there some way that we can call a VB ActiveX DLL class method that loads
a form non-modally from a VC++ DLL by either modifying the VC++ DLL client
that calls the method or by modifying the VB ActiveX DLL server that
contains the method?