How to extract binary data from a COleVariant data type and how to store binary data in a COleVariant data type (152294)
The information in this article applies to:
- Microsoft Visual C++ 4.0
- Microsoft Visual C++ 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2b
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2b
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q152294 SUMMARY
When using the DAO SDK C++ classes to access binary data (such as a bitmap)
you will find that the data is returned in a COleVariant. COleVariant is an
MFC class that wraps the OLE VARIANT data type. Within the VARIANT, the
data is stored as an OLE SAFEARRAY.
Extracting the binary data from the COleVariant requires some knowledge of
VARIANTs and SAFEARRAYs. The sample code below illustrates how to work with
these data types by providing a function for extracting binary data from a
COleVariant and a function for storing binary data in a COleVariant.
Modification Type: | Major | Last Reviewed: | 6/2/2005 |
---|
Keywords: | kbcode kbhowto kbProgramming KB152294 kbAudDeveloper |
---|
|