Note When using an ATL string conversion macro, specify the USES_CONVERSION macro at the beginning of your function in order to avoid compiler errors. For example:void func( LPSTR lpsz ) { USES_CONVERSION; ... LPWSTR x = A2W(lpsz) // Do something with x ... }
USES_CONVERSION;
{
USES_CONVERSION;
...
LPWSTR x = A2W(lpsz)
// Do something with x
...
}