注册项类型。
命名空间: 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] 项目类型的唯一标识符,它会显示注册表。
- pVsPF
类型:Microsoft.VisualStudio.Shell.Interop.IVsProjectFactory
[in] 为 IVsProjectFactory 接口的指针。
- 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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。