IVsOwnedProjectFactory::PreCreateForOwner Method (Object^, Object^, UInt32)

 

Gives the owned project a chance to create an aggregated project object based on the input controlling IUnknown (pUnkOwner).

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

int PreCreateForOwner(
	Object^ pUnkOwner,
	[OutAttribute] Object^% ppUnkInner,
	[OutAttribute] unsigned int% pCookie
)

Parameters

pUnkOwner
Type: System::Object^

[in] Pointer to an IUnknown owner object.

ppUnkInner
Type: System::Object^

[out] Pointer to a pointer to an IUnknown inner object.

pCookie
Type: System::UInt32

[out] Pointer to a cookie object.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From vsshell.idl:

HRESULT IVsOwnedProjectFactory::PreCreateForOwner(
   [in] IUnknown *pUnkOwner,
   [out] IUnknown **ppUnkInner,
   [out] VSOWNEDPROJECTOBJECT* pCookie
);

Called by the owner/outer so that the owned/inner project can create an aggregated version of itself, using pOwner as the controlling IUnknown. The owned project should only create its project object instance here. All the heavy initialization work should occur in InitializeForOwner. That ensures the owner/outer project will work correctly during the owned/inner initialization. The owned project must return its inner IUnknown and its Project object (cast as a VSOWNEDPROJECTOBJECT cookie) back to the owning project.

Return to top
Show: