a casting problem!
-
how do i cast a cstring to bstr? and from a bstr to cstring.. thanks
-
how do i cast a cstring to bstr? and from a bstr to cstring.. thanks
Make BSTR from CString: Use either CString member function
BSTR AllocSysString ( ) const;
orBSTR SetSysString( BSTR* pbstr ) const;
. And the other way, I don't really know, but perhaps a simple '=' is enough? CString strBla = bstrString; ? -Dominik
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) -
how do i cast a cstring to bstr? and from a bstr to cstring.. thanks
Check Michael Dunn's The Complete Guide to C++ Strings, Part I - Win32 Character Encodings [^] and The Complete Guide to C++ Strings, Part II - String Wrapper Classes [^]. Great stuff. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
-
how do i cast a cstring to bstr? and from a bstr to cstring.. thanks
Well, there are no casting routines. But you can use these conversion methods of CString: CString to BSTR:
AllocSysString
BSTR to CString :SetSysString
Or you use the _bstr_t class declared in<comdef.h>
, which is very comfortable. Jens -
Check Michael Dunn's The Complete Guide to C++ Strings, Part I - Win32 Character Encodings [^] and The Complete Guide to C++ Strings, Part II - String Wrapper Classes [^]. Great stuff. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
Thanks people...you are great people to have around.. it worked! :) kindest regards