Q: Converting char[] with null bytes to BSTR ? 
Author Message
 Q: Converting char[] with null bytes to BSTR ?

I have any array of char which is being passed as a parameter to an event in
VB.  Trying to use a String data type for this, but what is it that won't
quit at the first zero byte in the source array?

The event is being fired from a separate thread.  Does anyone know if I can
still pass as what VB considers ByVal, or is it necessary to pass ByRef
(marshalling bug in runtime) ?

TIA - Best Regards, Lee Gillie, Spokane WA



Mon, 25 Oct 2004 00:53:30 GMT  
 Q: Converting char[] with null bytes to BSTR ?


Fri, 19 Jun 1992 00:00:00 GMT  
 Q: Converting char[] with null bytes to BSTR ?
Does this char array contain binary data? If so, consider using
safearray of bytes instead of BSTR. Passing binary data in BSTR is
complicated for both C++ and VB programmer. While you can overcome this
difficulty, you probably don't want to make life difficult for your
client.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> I have any array of char which is being passed as a parameter to an
event in
> VB.  Trying to use a String data type for this, but what is it that
won't
> quit at the first zero byte in the source array?

> The event is being fired from a separate thread.  Does anyone know if
I can
> still pass as what VB considers ByVal, or is it necessary to pass
ByRef
> (marshalling bug in runtime) ?

> TIA - Best Regards, Lee Gillie, Spokane WA



Mon, 25 Oct 2004 00:59:21 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to convert a BSTR to BYTE *?

2. Convert BYTE to BSTR?

3. converting BYTE buffer to BSTR

4. Convert from BSTR* to CHAR*

5. converting BSTR to const char *

6. converting char to bstr

7. how to convert from bstr to char string

8. Convert from BSTR to TCHAR* or char*

9. Convert an BSTR in char *

10. How to convert char array to BSTR?

11. How to convert from BSTR to char

12. Conversion : How to convert from char* to BSTR ?

 

 
Powered by phpBB® Forum Software