VC++ pass object parameter to VB ActiveX DLL 
Author Message
 VC++ pass object parameter to VB ActiveX DLL

Hi everyone,
  I need to call VB ActiveX DLL method from VC++, how can
I pass an object (user-defined type) parameter which is
defined as a class type in VB ActiveX DLL.
  The VC++ classwizard will generate following method
declaration in wrapper class:
  void SetDocumentation(LPDISPATCH);

  In VB ActiveX DLL, the corresponding mehod would be:
  sub SetDocumentation(obj as CMyObject);

  My question is how can I create and pass LPDISPATCH in
VC++?

thanks in advance
anna



Mon, 21 Feb 2005 06:30:34 GMT  
 VC++ pass object parameter to VB ActiveX DLL

Quote:

>   I need to call VB ActiveX DLL method from VC++, how can
> I pass an object (user-defined type) parameter which is
> defined as a class type in VB ActiveX DLL.
>   The VC++ classwizard will generate following method
> declaration in wrapper class:
>   void SetDocumentation(LPDISPATCH);

>   In VB ActiveX DLL, the corresponding mehod would be:
>   sub SetDocumentation(obj as CMyObject);

C++ equivalent (assuming CMyObject is defined in the VB dll):

    HRESULT SetDocumentation(/*[in, out]*/ _CMyObject** obj);

Although I understand MFC does things differently, which is presumably
where the classwizard comes in.  If you're not using MFC, you should
use #import.

Quote:
>   My question is how can I create and pass LPDISPATCH in
> VC++?

Presumably you have an instance of CMyObject to pass.  Also presumably,
it's a dual interface.  In that case, you can QI it for IDispatch and
pass the result.


Mon, 21 Feb 2005 21:53:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. passing short array parameters to VC++ DLL in VB

2. Howto: Pass class object from VB ActiveX DLL to MFC

3. passing vb-object to vc++

4. Passing VB dictionaries as parameters to ATL COM objects

5. Problem using VB 5 activex DLL in a VC++ activex control

6. VB to VC parameter passing Safearray of UDT's

7. Variant parameter passing between VB and VC

8. function parameters to pass a VB string array to a C++ DLL

9. Basic Parameter Passing, VB vs VC

10. Variant parameter passing between VB and VC

11. Passing parameters from embedded VB to embedded VC++

12. Passing parameters from an ASP to an ActiveX DLL

 

 
Powered by phpBB® Forum Software