Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IMetaDataDispenser::DefineScope method

Creates a new area in memory in which you can create new metadata.

Syntax


HRESULT DefineScope(
  [in]  REFCLSID rclsid,
  [in]  DWORD    dwCreateFlags,
  [in]  REFIID   riid,
  [out] IUnknown **ppIUnk
);

Parameters

rclsid [in]

The CLSID of the version of metadata structures to be created.

dwCreateFlags [in]

Flags that specify options.

riid [in]

The IID of the desired metadata interface to be returned. The caller will use the interface to create the new metadata.

The value of riid must specify one of the "emit" interfaces. Valid values are IID_IMetaDataEmit, IID_IMetaDataAssemblyEmit, or IID_IMetaDataEmit2.

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

DefineScope creates a set of in-memory metadata tables, generates a unique GUID (module version identifier, or MVID) for the metadata, and creates an entry in the module table for the compilation unit being emitted.

Requirements

IDL

Rometadataapi.idl

See also

IMetaDataDispenser

 

 

Show: