--Stan
Gil Sudai schrieb in Nachricht <6k69oc$qsu$1...@news.ibm.net.il>...
It's somewhat more tricky. If the VARIANT is an VT_BSTR, the string may be
stored either as UNICODE or as ANSI string - depending from where you get
the string. Therefore you have something like this:
if is UNICODE
str = (LPCTSTR) (var.bstrVal)
else
str = (char*) var.pbVal
The only way I found to check if it's a UNICODE or single byte string is to
scan the string itself and determine the string format from the typical
UNICODE byte pattern xx 00 xx 00 - not a very clean way, and
IF SOMEONE HAS A BETTER SOLUTION; I WOULD APPRECIATE TO HEAR FROM IT!
for more information see "multibyte string survival guide" from the msdn