Click to See Complete Forum and Search --> : Passing structure from VC++ to VB


hnt
December 3rd, 1998, 03:19 PM
I would like to know if there is a way to pass a structure from VC++ to VB.

I created an ActiveX control which can passed parameter by value but I want to

pass an address of a structure back


Thank

CrazyD
December 3rd, 1998, 03:29 PM
Hi


You can pass a pointer to the struct (like in the GetWindowRect -> LPRECT)

In VB declare this as ....(...., MyVar As MyStruct) ( just as in the GetWindowRect)

VB's default for passing values is ByRef, which is a kind of a pointer.

So it should work. Although you might have some troubles if the struct contains char pointers. VB might have some trouble with that, because the sizeof of the struct is unknown at that point.


Hope it helps


Crazy D