|
-
February 9th, 2007, 11:46 AM
#8
Re: unsigned char * (BYTE*) to BSTR and back
For anyone who may be interested:
The original issue for me was to get an encrypted BYTE* array of binary values stored into a SQL Server database.
I chose BSTR as the vehicle but that seems to have been incorrect.
I received from invaluable help from Krzemo in the CodeGuru Database forum.
I was told that although BSTR can contain binary values, it cannot be used to store binary values into a database.
I was advised to convert my BYTE* array to SAFEARRAY and use the SAFEARRAY to write to/read from the database.
To convert to/from BYTE* and SAFEARRAY, I adapted code from the sample in
http://www.codeproject.com/database/...select=1608797
All seems to be well.
jim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|