IVsRegisterProjectTypes.RegisterProjectType Method
Registers a project type.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
‘선언
Function RegisterProjectType ( _
ByRef rguidProjType As Guid, _
pVsPF As IVsProjectFactory, _
<OutAttribute> ByRef pdwCookie As UInteger _
) As Integer
‘사용 방법
Dim instance As IVsRegisterProjectTypes
Dim rguidProjType As Guid
Dim pVsPF As IVsProjectFactory
Dim pdwCookie As UInteger
Dim returnValue As Integer
returnValue = instance.RegisterProjectType(rguidProjType, _
pVsPF, pdwCookie)
int RegisterProjectType(
ref Guid rguidProjType,
IVsProjectFactory pVsPF,
out uint pdwCookie
)
int RegisterProjectType(
[InAttribute] Guid% rguidProjType,
[InAttribute] IVsProjectFactory^ pVsPF,
[OutAttribute] unsigned int% pdwCookie
)
function RegisterProjectType(
rguidProjType : Guid,
pVsPF : IVsProjectFactory,
pdwCookie : uint
) : int
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.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
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.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVsRegisterProjectTypes Interface