VC9:USES_CONVERSION有什么作用? [英] VC9: What does USES_CONVERSION do?

查看:106
本文介绍了VC9:USES_CONVERSION有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

USES_CONVERSION的确切功能是什么.我已经在线浏览了许多资料,但无法掌握USES_CONVERSION的确切用法.

一个简单的解释将非常有帮助.

谢谢.

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.

推荐答案

这似乎是为某些bstr/wstr函数在堆栈上创建几个本地变量的简写...

http://www.codeproject.com/Messages/1870028/Re-USES_CONVERSION.aspx [ ^ ]
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[^]


USES_CONVERSION是一个宏,当我们使用OLE2T,T2W等字符串转换时,可以在函数的开头或转换之前添加此宏,以避免编译器错误.

如果您使用的是ATL7.0,则无需使用此宏.

-> [
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.

->[^]


从定义中可以看到:
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...


这篇关于VC9:USES_CONVERSION有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆