? regarding passing data from VC to VB using ActiveX control 
Author Message
 ? regarding passing data from VC to VB using ActiveX control

Hi There,

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?

Thanks-in-advance,

Thomas Eng



Fri, 30 Aug 2002 03:00:00 GMT  
 ? 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.



Fri, 30 Aug 2002 03:00:00 GMT  
 ? regarding passing data from VC to VB using ActiveX control
If you are just opening up a socket connection you might try using the
MSWinSck.OCX that comes with VB to do the job instead of writing your
own control. It allows you to read and write string variables in and
out the socket and it is very easy to use.
Just a suggestion.

For more TCP/IP solutions visit www.taltech.com



Quote:
>Hi There,

>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?

>Thanks-in-advance,

>Thomas Eng



Thu, 05 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Some information needed regarding ActiveX controls using VB

2. Some information needed regarding ActiveX controls using VB

3. Problem using Crystal report ActiveX installed with VB and used in VC.

4. EASY Way to Pass SAFEARRAY from VC to VB using COM

5. calling VB activex control from VC

6. Passing Parameters to stored parameter queries using VB 5's Data Controls

7. I'm new to VB, regarding ADO msflexgrid controls using odbc, Excell spreadsheet

8. How to pass a VB intrinsic Control as parameter to an ActiveX control (UserControl)

9. How to pass data to ActiveX control?

10. Passing Data from ActiveX Control to Container...

11. URGENT: Can't pass parameters using Crystal ActiveX control

12. Passing String Arrays between VB and VC

 

 
Powered by phpBB® Forum Software