다음을 통해 공유


IVsOwnedProjectFactory Interface

Used by projects that support being aggregated by an Owner to persist the OwnerKey in their project file.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

‘선언
<GuidAttribute("E4197123-1086-4D51-B2D5-903F4D61C5AA")> _
<InterfaceTypeAttribute()> _
Public Interface IVsOwnedProjectFactory
‘사용 방법
Dim instance As IVsOwnedProjectFactory
[GuidAttribute("E4197123-1086-4D51-B2D5-903F4D61C5AA")]
[InterfaceTypeAttribute()]
public interface IVsOwnedProjectFactory
[GuidAttribute(L"E4197123-1086-4D51-B2D5-903F4D61C5AA")]
[InterfaceTypeAttribute()]
public interface class IVsOwnedProjectFactory
public interface IVsOwnedProjectFactory

Remarks

Projects that support being aggregated by an Owner must persist the OwnerKey in their project file. When CreateProject is called on a project with an OwnerKey, the owned project should convert its OwnerKey to a project factory GUID then call CreateProject on this project factory to do the actual creation.

An owner will create its owned project in two phases:

  1. Call PreCreateForOwner. This gives the owned project a chance to create an aggregated project object based on the input controlling IUnknown (pUnkOwner). The owned project passes back the inner IUnknown and the aggregated object to the owner project, giving it a chance to store the inner IUnknown.

  2. Call InitializeForOwner. The owned project does all its instantiation here (what usually goes into CreateProject on unowned projects). The input VSOWNEDPROJECTOBJECT is typically the aggregated owned project. The owned project can use this variable to determine if its project object has already been created (cookie !=nulla null reference (Nothing in Visual Basic)) or needs to be created (cookie==nulla null reference (Nothing in Visual Basic)).

Related Property: VSHPROPID_OwnerKey — BSTR owner key string that identifies the project GUID of the owning project. Only projects that implement IVsOwnedProjectFactory should support this property.

For more information about the implementation of this interface, see the samples Basic Project, Figures Project, and My C Package.

Notes to Implementers:

Implemented by projects that support being aggregated by an Owner to persist the OwnerKey in their project file.

Notes to Callers:

Called by an owner to create its owned project.

See Also

Reference

IVsOwnedProjectFactory Members

Microsoft.VisualStudio.Shell.Interop Namespace