Show modeless form in VB ActiveX DLL from C++ MFC DLL 
Author Message
 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?



Mon, 04 Dec 2000 03:00:00 GMT  
 Show modeless form in VB ActiveX DLL from C++ MFC DLL

I think you're on the right track here (C++dll --> VB dll ----> C++ dll
calls).  That might get you around the modality question with VB ActiveX
forms.  There is some discussion of modality in VB BOL in the Component
creation section that you might want to check out (doesn't get as down and
dirty as you probably want, but it might give you some ideas as to what's
happening).

Quote:

>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?



Sat, 09 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Showing modeless form in VB ActiveX Dll

2. Help with Visual Basic ActiveX DLL showing form within Visual C++ ATL app

3. ActiveX DLL and modeless forms

4. accessing objects in a c++ DLL from a c++ activeX control placed in a VB application

5. accessing objects in a c++ DLL from a c++ activeX control placed in a VB application

6. how to use a VB active dll which include Form at a c++ program

7. how to use a VB active dll which include Form at a c++ program

8. ATL DLL event sink with a VB ActiveX DLL event source

9. Creating c dll calling vb ActiveX dll

10. Help with VB ActiveX Control and MFC DLL

11. MFC app calling VB ActiveX DLL

12. Calling a VB ActiveX dll from MFC

 

 
Powered by phpBB® Forum Software