IVsRegisterProjectTypes::RegisterProjectType Method (Guid, IVsProjectFactory^, UInt32)
Registers a project type.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int RegisterProjectType( [InAttribute] Guid% rguidProjType, IVsProjectFactory^ pVsPF, [OutAttribute] unsigned int% pdwCookie )
Parameters
- rguidProjType
-
Type:
System::Guid
[in] Unique identifier of the project type as it appears in the registry.
- pVsPF
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsProjectFactory^
[in] Pointer to the IVsProjectFactory interface.
- pdwCookie
-
Type:
System::UInt32
[out] Abstract handle used to retrieve this entry from the environment and to unregister the project type.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsRegisterProjectTypes::RegisterProjectType( [in] REFGUID rguidProjType, [in] IVsProjectFactory *pVsPF, [out] VSCOOKIE *pdwCookie );
The RegisterProjectType method is called in SetSite method. In SetSite, the package creates its project factory and passes a pointer to the IVsProjectFactory interface to the environment by calling RegisterProjectType.
The environment uses the pointer to create projects from this project type using the CreateProject method.
The environment knows which package to load for a specific project type from the registry data.