C++ Preprosessor import
#import Attributes
Provides links to attributes used with the #import directive.
Microsoft Specific
The following attributes are available to the #import directive.
Attribute |
Description |
---|---|
Renames C++ reserved words by appending two underscores (__) to the variable name to resolve potential name conflicts. |
|
Specifies that, when a type library is referenced with #import and itself references another type library, the compiler can do an implicit #import for the other type library. |
|
Specifies that the type library is written to the .tlh file with the attribute-generated code preserved. |
|
Excludes items from the type library header files being generated. |
|
Specifies a prefix to be used in naming high-level properties and methods. |
|
Specifies alternate prefixes for three property methods. |
|
Suppresses the generation of the .tlh header file (the primary header file). |
|
Disables automatic exclusion. |
|
Inserts its argument as source text into the type-library header. |
|
Tells the compiler to define and initialize GUID variables in old style, of the form LIBID_MyLib, CLSID_MyCoClass,IID_MyInterface, and DIID_MyDispInterface. |
|
Disables automatic exclusion. |
|
Changes the way the compiler generates wrapper functions for dual interface methods. |
|
Suppresses the generation of the .tli header, which contains the implementations of the wrapper member functions. |
|
Specifies that the namespace name is not generated by the compiler. |
|
Tells the compiler not to search the registry for type libraries. |
|
Has the same functionality as the no_namespace attribute but is used on type libraries that you use the #import directive with the auto_search attribute. |
|
Suppresses the creation of smart pointers for all interfaces in the type library. |
|
Tells the compiler to generate low-level wrapper functions for dispinterface methods and properties that callIDispatch::Invoke and return the HRESULT error code. |
|
Suppresses the generation of error-handling wrapper functions and property (C++) declarations that use those wrapper functions. |
|
Specifies a different prefix to avoid name collisions. |
|
Disables the use of COM support classes in the high-level wrapper functions and forces the use of low-level data types instead. |
|
Specifies alternate prefixes for three property methods. |
|
Works around name collision problems. |
|
Renames the namespace that contains the contents of the type library. |
|
Has the same functionality as the rename_namespaceattribute but is used on type libraries that you use the #import directive with the auto_search attribute. |
|
Allows for loading libraries other than the primary type library. |
END Microsoft Specific
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)