Article ID: 154172 - View products that this article applies to.
This article was previously published under Q154172
This article has been archived. It is offered "as is" and will no longer be updated.
This article will demonstrate how to pass an array of bytes between Visual Basic and an ActiveX (OLE) Control. This is accomplished by creating a method that takes a VARIANT parameter that will contain a SafeArray of bytes.
Exchanging data in this manner is useful for both raw data and as a technique for passing data structures.
WARNING: Passing data structures in this manner can pose problems if it contains pointers.
NOTE: Code for Visual Basic 4.0 where BinData is the name of the control:
For more information, please see the following articles in the Microsoft Knowledge Base:
122287Microsoft Systems Journal, June 1996, "Q&A OLE" by Don Box.
(http://support.microsoft.com/kb/122287/EN-US/ )Limits of VB 3.0 & Disptest as Automation Controllers
(http://support.microsoft.com/kb/131046/EN-US/ )SAMPLE: BINARY: Transfer Binary Data Using OLE Automation
(http://support.microsoft.com/kb/131086/EN-US/ )SAMPLE: SAFEARAY: Use of Safe Arrays in Automation
(http://support.microsoft.com/kb/140202/EN-US/ )SAMPLE: MFCARRAY: Using Safe Arrays in MFC Automation
(http://support.microsoft.com/kb/122289/EN-US/ )Passing Structures in OLE Automation
Contact us for more help