How to pass vb Object into ATL component 
Author Message
 How to pass vb Object into ATL component

How do i have to declare the idl description of a vc/atl function to
pass it an Visual Basic Object-Type? is it IDispatch od IUnknown that
i have to use?

In Vb...

  Function MyFunction( ByVal Name as String, ByVal TheObject As Object
)

in VC/ATL/IDL

  ...
  ... HRESULT MyFunction( [in] BSTR Name, [in] IUnknown* pUnk )
  ...

or

  ...
  ... HRESULT MyFunction( [in] BSTR Name, [in] IDispatch* pDisp )
  ...

Thanx
Andreas



Thu, 25 Mar 2004 06:12:59 GMT  
 How to pass vb Object into ATL component

Quote:

> How do i have to declare the idl description of a vc/atl function to
> pass it an Visual Basic Object-Type? is it IDispatch od IUnknown that
> i have to use?

> In Vb...

>   Function MyFunction( ByVal Name as String, ByVal TheObject As Object
> )

> in VC/ATL/IDL

>   ...
>   ... HRESULT MyFunction( [in] BSTR Name, [in] IUnknown* pUnk )
>   ...

> or

>   ...
>   ... HRESULT MyFunction( [in] BSTR Name, [in] IDispatch* pDisp )
>   ...

> Thanx
> Andreas

It is IDispatch! (Learning by doing!) :-)


Thu, 25 Mar 2004 14:59:03 GMT  
 How to pass vb Object into ATL component
IDispatch will work, but using IUnknown will support objects with both dual
and custom interfaces.

Dave



Quote:
> > How do i have to declare the idl description of a vc/atl function to
> > pass it an Visual Basic Object-Type? is it IDispatch od IUnknown that
> > i have to use?

> > In Vb...

> >   Function MyFunction( ByVal Name as String, ByVal TheObject As Object
> > )

> > in VC/ATL/IDL

> >   ...
> >   ... HRESULT MyFunction( [in] BSTR Name, [in] IUnknown* pUnk )
> >   ...

> > or

> >   ...
> >   ... HRESULT MyFunction( [in] BSTR Name, [in] IDispatch* pDisp )
> >   ...

> > Thanx
> > Andreas

> It is IDispatch! (Learning by doing!) :-)



Fri, 26 Mar 2004 11:08:20 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Passing a 2D SafeArray from VB client to ATL COM component

2. Passing component pointer from atl service to vb

3. passing strings from ATL component to VB app

4. How to pass an ADODB.Stream object from VB to a method in a C++ component

5. ATL Component: Err object in VB???

6. Passing Arrays Between VB and ATL COM object

7. passing com/atl object in vb

8. Passing VB dictionaries as parameters to ATL COM objects

9. Passing String from VB to atl object

10. trouble passing String from VB to ATL com object expecting BSTR

11. Passing VB Objects to ATL and use it

12. Help: Passing strings between VB and ATL-COM objects

 

 
Powered by phpBB® Forum Software