IVsRegisterProjectTypes.RegisterProjectType 方法

注册项类型。

命名空间:  Microsoft.VisualStudio.Shell.Interop
程序集:  Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)

语法

声明
Function RegisterProjectType ( _
    ByRef rguidProjType As Guid, _
    pVsPF As IVsProjectFactory, _
    <OutAttribute> ByRef pdwCookie As UInteger _
) As Integer
int RegisterProjectType(
    ref Guid rguidProjType,
    IVsProjectFactory pVsPF,
    out uint pdwCookie
)

参数

  • rguidProjType
    类型:System.Guid%
    [in] 项目类型的唯一标识符,它会显示注册表。
  • pdwCookie
    类型:System.UInt32%
    [out] 用于的抽象处理检索此项从环境和注销到项类型。

返回值

类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 vsshell.idl:

HRESULT IVsRegisterProjectTypes::RegisterProjectType(
   [in] REFGUID rguidProjType,
   [in] IVsProjectFactory *pVsPF,
   [out] VSCOOKIE *pdwCookie
);

RegisterProjectType 方法在 SetSite 方法调用。在 SetSite,包创建其项目工厂并通过指向 IVsProjectFactory 接口对环境通过调用 RegisterProjectType。

使用 CreateProject 方法,环境使用指针创建从此项目类型的项。

该环境知道要加载的哪个包从注册表数据的特定项目类型的。

.NET Framework 安全性

请参见

参考

IVsRegisterProjectTypes 接口

Microsoft.VisualStudio.Shell.Interop 命名空间