Converting strings.
ATL / WTL / STL
2
Posts
2
Posters
0
Views
1
Watching
-
Hi. I know how to convert strings to BSTR, COleVariant, and ect.. but how do you convert them back to regular ansi that the Windows API requires. Thanks in advance. Martin.
-
Hi. I know how to convert strings to BSTR, COleVariant, and ect.. but how do you convert them back to regular ansi that the Windows API requires. Thanks in advance. Martin.
Well, refer to the ATL String Conversion Macros[^]. Basically you'd be using one of these: OLE2CA (which will make ole/bstr into ansi const char*), OLE2CW (same, but for unicode), or just OLE2CT (which converts depending on your settings for using ANSI / _UNICODE)
"The greatest danger to humanity is humanity without an open mind."
- Ian Mariano - http://www.ian-space.com/