How To Pass Binary Data Between an ActiveX Control and VB
This article was previously published under Q154172 On This PageSUMMARY
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.
MORE INFORMATION
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. Sample Code
NOTE: Code for Visual Basic 4.0 where BinData is the name of the control:
REFERENCES
For more information, please see the following articles in the Microsoft
Knowledge Base:
122287 (http://support.microsoft.com/kb/122287/EN-US/)
Limits of VB 3.0 & Disptest as Automation Controllers
Microsoft Systems Journal, June 1996, "Q&A OLE" by Don Box.
131046 (http://support.microsoft.com/kb/131046/EN-US/) SAMPLE: BINARY: Transfer Binary Data Using OLE Automation 131086 (http://support.microsoft.com/kb/131086/EN-US/) SAMPLE: SAFEARAY: Use of Safe Arrays in Automation 140202 (http://support.microsoft.com/kb/140202/EN-US/) SAMPLE: MFCARRAY: Using Safe Arrays in MFC Automation 122289 (http://support.microsoft.com/kb/122289/EN-US/) Passing Structures in OLE Automation APPLIES TO
| Article Translations
|
Back to the top
