Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IMetaDataDispenser::DefineScope Method

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

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

rclsid

[in] The CLSID of the version of metadata structures to be created. This value must be CLSID_CorMetaDataRuntime for the .NET Framework version 2.0.

dwCreateFlags

[in] Flags that specify options. This value must be zero for the .NET Framework 2.0.

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.

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.

You can attach attributes to the metadata scope as a whole by using the IMetaDataEmit::SetModuleProps or IMetaDataEmit::DefineCustomAttribute method, as appropriate.

Platform: See .NET Framework System Requirements.

Header: Cor.h

Library: Used as a resource in MsCorEE.dll

.NET Framework Versions: 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft