
? regarding passing data from VC to VB using ActiveX control
Quote:
> Hi There,
Hi.
> I am trying to write an ActiveX control to allow a Visual Basic application
> to receive data from a special socket connection. I have written my control
> in VCPP. I am having problems passing the data that my ActiveX control
> receives to my VB application. My current approach is to first fire an
> event to signify to the VB application that data has arrived. The VB
> application then makes a call to a method of the ActiveX control to retrieve
> the data. However, I am not sure how to pass the binary data from the
> ActiveX control (written in VCPP) to Visual Basic.
> Can anyone offer some suggestions? I'm not sure what data types should my
> parameters be to pass an array of binary data to my application. I looked a
> little at the Microsoft Winsock control's "GetData" interface, and a pointer
> to a VARIANT is used. Should I also do something similar?
You could, and it would work. You can also pass a
SAFEARRAY with a runtime established type of Byte.
You should pass it by doubly indirect reference to
be compatable with VB's array passing convention.
(That would be a pointer to a pointer to SAFEARRAY.)
Even if you use the VARIANT method, you will end up
putting a SAFEARRAY into the VARIANT.
--
Larry Brasfield
Above opinions may be mine alone.