Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
What is the exact function of USES_CONVERSION. I have looked through a lot of material online but am not able to grasp the exact use of USES_CONVERSION.

A simple explanation would be really helpful.

Thanks.
Posted
Updated 16-May-11 23:50pm
v2

it would appear to be shorthand for creating a couple of locals on your stack for some bstr/wstr functions ...

http://www.codeproject.com/Messages/1870028/Re-USES_CONVERSION.aspx[^]
 
Share this answer
 
Comments
Albert Holguin 17-May-11 9:32am    
didn't see the link before I posted a solution, my 5
USES_CONVERSION Is a macro and when we are using String conversion like OLE2T, T2W etc than we can add this macro at the beginning of function or before conversion to avoid compiler errors.

If you are using ATL7.0 than no need to use this macro.

->[^]
 
Share this answer
 
As you can see from the definition:
#define USES_CONVERSION int _convert = 0; (_convert); UINT _acp = ATL::_AtlGetConversionACP() /*CP_THREAD_ACP*/; (_acp); LPCWSTR _lpw = NULL; (_lpw); LPCSTR _lpa = NULL; (_lpa)


its just initialization for other macros...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900