Share via


ImportFile Method

Imports assemblies and unbound modules.

HRESULT ImportFile(
    LPCWSTR pszFilename,
    LPCWSTR pszTargetName,
    BOOL fSmartImport,
    mdToken* pImportToken,
    IMetaDataAssemblyImport** ppAssemblyScope,
    DWORD* pdwCountOfScopes
) PURE;

Parameters

  • pszFilename
    Fully qualified name of file to be imported.

  • pszTargetName
    Optional output file name that can be used to rename the file as it is linked into the assembly.

  • fSmartImport
    If TRUE, ImportTypes is used, otherwise importing must be performed manually.

  • pImportToken
    Pointer to token where a unique file ID will be stored. The file can be an assembly or a file.

  • ppAssemblyScope
    Receives pointer to IMetaDataAssemblyImport Interface. Can be NULL if the file is not an assembly.

  • pdwCountOfScopes
    Pointer to the count of files and/or scopes that have been imported.

Return Value

Returns S_OK if the method succeeds.

Requirements

Requires alink.h

See Also

Concepts

ALink API (Unmanaged API Reference)

Other Resources

IALink Interface

IALink2 Interface