IMetaDataDispenser::OpenScope method
Opens an existing, on-disk file and maps its metadata into memory.
Syntax
HRESULT OpenScope( [in] LPCWSTR szScope, [in] DWORD dwOpenFlags, [in] REFIID riid, [out] IUnknown **ppIUnk );
Parameters
- szScope [in]
-
The name of the file to be opened. The file must contain common language runtime (CLR) metadata.
- dwOpenFlags [in]
-
Specifies the mode (read, write, and so on) for opening. value of the CorOpenFlags enumeration to specify the mode (read, write, and so on) for opening.
- riid [in]
-
The IID of the desired metadata interface to be returned; the caller will use the interface to import (read) or emit (write) metadata.
- ppIUnk [out]
-
The pointer to the returned interface.
Return value
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The in-memory copy of the metadata can be queried using methods from one of the "import" interfaces, or added to using methods from the one of the "emit" interfaces.
If the target file does not contain CLR metadata, the OpenScope method will fail.
Requirements
|
IDL |
|
|---|
See also