import
The document is archived and information here might be outdated

import

Specifies another .idl, .odl, or header file containing definitions you want to reference from your main IDL.

[ import(
   idl_file
) ];

Parameter

idl_file
The name of an .idl file that you want imported into the type library of the current project.

Attribute Context

Applies to Anywhere
Repeatable No
Required attributes None
Invalid attributes None

For more information, see Attribute Contexts.

Remarks

The import C++ attribute causes an #import statement to be placed below the import "docobj.idl" statement in the generated .idl file. The import attribute has the same functionality as the import MIDL attribute.

Example

The following code:

// cpp_attr_ref_import.cpp
// compile with: /LD
[module(name="MyLib")];
[import(import.idl)];

produces the following code in the generated .idl file:

import "docobj.idl";
import "import.idl";

[ uuid(EED3644C-8488-3ECD-BA97-147DB3CDB499), version(1.0) ]
library MyLib {
   importlib("stdole2.tlb");
   importlib("olepro32.dll");
...

See Also

IDL Attributes | Stand-Alone Attributes | importidl | importlib | include | includelib | Attributes Samples

Show:
© 2016 Microsoft