MFC Client, VB COM Server Question 
Author Message
 MFC Client, VB COM Server Question

Hi all,

I ran into a problem and can not figure out how to do it. I need to access a
COM Server written by VB and need to use a function type like this
function ABC(num as Long, result() as Single, result2() as Long) As Long;

In Visual Basic it is very simple -
dim a() as Single
dim b() as Long

ABC(a, b)

However, I need to do it using MFC. The type library is not released and the
only way is to use late binding by using IDispatch interface. I wonder how
to encapsulate these SAFEARRAY  into DISPARAMS.

You comment are really appreciated. thanks in advance.



Sun, 12 Dec 2004 04:26:22 GMT  
 MFC Client, VB COM Server Question
You use VARIANTs. Your DISPARAMS are of type VTS_VARIANT

The array result 2 is a safearray of long this is defined in variant terms
by

VARAINT variant;
variant.vt  = VT_ARRAY|VT_I4;
variant.pArray =

If you've got a reasonable brain and look at all the MFC source code
associated with COleSafeArray ( OLEVAR.CPP ) you should easily see how this
is done.


Quote:
> Hi all,

> I ran into a problem and can not figure out how to do it. I need to access
a
> COM Server written by VB and need to use a function type like this
> function ABC(num as Long, result() as Single, result2() as Long) As Long;

> In Visual Basic it is very simple -
> dim a() as Single
> dim b() as Long

> ABC(a, b)

> However, I need to do it using MFC. The type library is not released and
the
> only way is to use late binding by using IDispatch interface. I wonder how
> to encapsulate these SAFEARRAY  into DISPARAMS.

> You comment are really appreciated. thanks in advance.



Sun, 12 Dec 2004 11:50:56 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MFC client access a VB COM Server with SAFEARRAY argument

2. MFC client access a VB COM Server with SAFEARRAY argument

3. problems passing ADO Recordset from VB-COM client to VC-COM-Server dll

4. Passing a structure between a VB client and an ATL com server

5. Problems using a ATL COM EXE Server with VB Client

6. vb client of a c++ dll-based COM server

7. Accessing a collection from a VB com server in a VC/ATL Client

8. sending many data type in COM Server to MFC Client

9. MFC Client - COM Server

10. Problem calling VB COM dll from VC++ multithreaded COM EXE client

11. Client Server problem: CLIENT printerDC not available on SERVER

12. Non-MFC OLE client calling MFC-built server DLL

 

 
Powered by phpBB® Forum Software