--- description: "Learn more about: #import attributes (C++)" title: "#import attributes (C++)" ms.date: "08/29/2019" helpviewer_keywords: ["#import directive, attributes"] ms.assetid: 2a5085e3-82ee-4f83-892b-0aa6cc13863b --- # #import attributes (C++) Provides links to attributes used with the `#import` directive. **Microsoft Specific** The following attributes are available to the `#import` directive. |Attribute|Description| |---------------|-----------------| |[auto_rename](../preprocessor/auto-rename.md)|Renames C++ reserved words by appending two underscores (__) to the variable name to resolve potential name conflicts.| |[auto_search](../preprocessor/auto-search.md)|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.| |[embedded_idl](../preprocessor/embedded-idl.md)|Specifies that the type library is written to the .tlh file with the attribute-generated code preserved.| |[exclude](../preprocessor/exclude-hash-import.md)|Excludes items from the type library header files being generated.| |[high_method_prefix](../preprocessor/high-method-prefix.md)|Specifies a prefix to be used in naming high-level properties and methods.| |[high_property_prefixes](../preprocessor/high-property-prefixes.md)|Specifies alternate prefixes for three property methods.| |[implementation_only](../preprocessor/implementation-only.md)|Suppresses the generation of the .tlh header file (the primary header file).| |[include()](../preprocessor/include-parens.md)|Disables automatic exclusion.| |[inject_statement](../preprocessor/inject-statement.md)|Inserts its argument as source text into the type-library header.| |[named_guids](../preprocessor/named-guids.md)|Tells the compiler to define and initialize GUID variables in old style, of the form `LIBID_MyLib`, `CLSID_MyCoClass`, `IID_MyInterface`, and `DIID_MyDispInterface`.| |[no_auto_exclude](../preprocessor/no-auto-exclude.md)|Disables automatic exclusion.| |[no_dual_interfaces](../preprocessor/no-dual-interfaces.md)|Changes the way the compiler generates wrapper functions for dual interface methods.| |[no_implementation](../preprocessor/no-implementation.md)|Suppresses the generation of the .tli header, which contains the implementations of the wrapper member functions.| |[no_namespace](../preprocessor/no-namespace.md)|Specifies that the namespace name is not generated by the compiler.| |[no_registry](../preprocessor/no-registry.md)|Tells the compiler not to search the registry for type libraries.| |[no_search_namespace](../preprocessor/no-search-namespace.md)|Has the same functionality as the [no_namespace](../preprocessor/no-namespace.md) attribute but is used on type libraries that you use the #import directive with the [auto_search](../preprocessor/auto-search.md) attribute.| |[no_smart_pointers](../preprocessor/no-smart-pointers.md)|Suppresses the creation of smart pointers for all interfaces in the type library.| |[raw_dispinterfaces](../preprocessor/raw-dispinterfaces.md)|Tells the compiler to generate low-level wrapper functions for dispinterface methods and properties that call `IDispatch::Invoke` and return the HRESULT error code.| |[raw_interfaces_only](../preprocessor/raw-interfaces-only.md)|Suppresses the generation of error-handling wrapper functions and [property](../cpp/property-cpp.md) declarations that use those wrapper functions.| |[raw_method_prefix](../preprocessor/raw-method-prefix.md)|Specifies a different prefix to avoid name collisions.| |[raw_native_types](../preprocessor/raw-native-types.md)|Disables the use of COM support classes in the high-level wrapper functions and forces the use of low-level data types instead.| |[raw_property_prefixes](../preprocessor/raw-property-prefixes.md)|Specifies alternate prefixes for three property methods.| |[rename](../preprocessor/rename-hash-import.md)|Works around name collision problems.| |[rename_namespace](../preprocessor/rename-namespace.md)|Renames the namespace that contains the contents of the type library.| |[rename_search_namespace](../preprocessor/rename-search-namespace.md)|Has the same functionality as the [rename_namespace](../preprocessor/rename-namespace.md) attribute but is used on type libraries that you use the #import directive with the [auto_search](../preprocessor/auto-search.md) attribute.| |[tlbid](../preprocessor/tlbid.md)|Allows for loading libraries other than the primary type library.| **END Microsoft Specific** ## See also [#import directive](../preprocessor/hash-import-directive-cpp.md)