This documentation is archived and is not being maintained.

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)

[GuidAttribute("E4197123-1086-4D51-B2D5-903F4D61C5AA")] 
[InterfaceTypeAttribute(1)] 
public interface IVsOwnedProjectFactory
/** @attribute GuidAttribute("E4197123-1086-4D51-B2D5-903F4D61C5AA") */ 
/** @attribute InterfaceTypeAttribute(1) */ 
public interface IVsOwnedProjectFactory
GuidAttribute("E4197123-1086-4D51-B2D5-903F4D61C5AA") 
InterfaceTypeAttribute(1) 
public interface IVsOwnedProjectFactory

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 !=a null reference (Nothing in Visual Basic)) or needs to be created (cookie==a 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 Sample, Figures Project Sample, and My C Package Sample.

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.

Show: