Share via


ImportFileEx2 Method

Imports assemblies and unbound modules. This method is like ImportFile Method, but works even if the file being imported does not exist on disk.

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

Parameters

  • pszFilename
    Name of file to be imported.

  • pszTargetName
    Optional name of target file.

  • pAssemblyScopeIn
    Optional import scope IMetaDataAssemblyImport Interface interface.

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

  • dwOpenFlags
    Flags to be passed along to IMetaDataDispenser::OpenScope Method.

  • pImportToken
    Receives unique ID for the assembly or file.

  • ppAssemblyScope
    Receives assembly import scope IMetaDataAssemblyImport Interface interface. Can be NULL if the file is not an assembly.

  • pdwCountOfScopes
    Receives the number of files and/or scopes imported.

Return Value

Returns S_OK if the method succeeds.

Requirements

Requires alink.h.

See Also

Concepts

IALink2 Interface

IALink Interface

ALink API (Unmanaged API Reference)