   CA2W?
  Hey all, quite simple this one i think.. Im using D3DXCreateTextureFromFile with D3DXMATERIAL::THE_TEXTURE and it gives me the old "cannot convert parameter 2 from 'LPSTR' to 'LPCWSTR'". I read somewhere that an easy solution for this is a macro called 'CA2W' which converts to unicode friendly strings, i couldnt find any informaiton on it so if anyone can help i would be grateful.   
  CA2W is defined by ATL, I believe in atlconv.h, though I think it's actually a typedef for a class that defines a narrow character string constructor and a conversion operator to a const wide character string.;  This isn't specific to DirectX so I'm moving it to 'General Programming' [smile]The ATL functions have often struck me as a little cryptic at times. Very useful, but not always easy to work with. You might try starting at the ATL and MFC String Conversion Macros doc's page. There is one page that covers all of the something2something functions rather than individual doc pages for each.hthJack   ;  The ATL string narrowing/widening functions are actually macros that expand the appropriate expressions for both ANSI and UNICODE builds.  In addition to what ATL provides, there are functions in the VC runtime that do this: mbstowcs and wcstombs (multi-byte string to wide character string, wide character string to multi-byte string).  You can use the VC runtime functions if you don't want to be dependent upon ATL.   ;  Not all of them are macros. As I've mentioned CA2W is a typedef, as is CW2W, CA2A, CA2CA, CW2CW and CW2A. Some of them are actually inline functions defined in atlconv.h.   ;Quote:Original post by SiCraneNot all of them are macros. As I've mentioned CA2W is a typedef, as is CW2W, CA2A, CA2CA, CW2CW and CW2A. Some of them are actually inline functions defined in atlconv.h.Yep.  I think the last time I looked at how these were implemented was 1998, so either my memory is off or they changed how they were implemented since then.   ;  Thanks for your responses, reading up on it now :)   