IVsRegisterProjectTypes.RegisterProjectType 方法

定义

注册项目类型。

public:
 int RegisterProjectType(Guid % rguidProjType, Microsoft::VisualStudio::Shell::Interop::IVsProjectFactory ^ pVsPF, [Runtime::InteropServices::Out] System::UInt32 % pdwCookie);
public int RegisterProjectType (ref Guid rguidProjType, Microsoft.VisualStudio.Shell.Interop.IVsProjectFactory pVsPF, out uint pdwCookie);
abstract member RegisterProjectType : Guid * Microsoft.VisualStudio.Shell.Interop.IVsProjectFactory * uint32 -> int
Public Function RegisterProjectType (ByRef rguidProjType As Guid, pVsPF As IVsProjectFactory, ByRef pdwCookie As UInteger) As Integer

参数

rguidProjType
Guid

中显示在注册表中的项目类型的唯一标识符。

pVsPF
IVsProjectFactory

中指向接口的指针 IVsProjectFactory

pdwCookie
UInt32

弄用于从环境中检索此项并取消注册项目类型的抽象句柄。

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

COM 签名

从 vsshell:

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

方法 RegisterProjectType 在方法中调用 SetSite 。 在中 SetSite ,包通过调用来创建其项目工厂并向环境传递指向接口的指针 IVsProjectFactory RegisterProjectType

环境使用指针通过方法从此项目类型创建项目 CreateProject

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

适用于