Condividi tramite


IVsOwnedProjectFactory.PreCreateForOwner Method

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)

Syntax

'Declaration
Function PreCreateForOwner ( _
    pUnkOwner As Object, _
    <OutAttribute> ByRef ppUnkInner As Object, _
    <OutAttribute> ByRef pCookie As UInteger _
) As Integer
int PreCreateForOwner(
    Object pUnkOwner,
    out Object ppUnkInner,
    out uint pCookie
)
int PreCreateForOwner(
    [InAttribute] Object^ pUnkOwner, 
    [OutAttribute] Object^% ppUnkInner, 
    [OutAttribute] unsigned int% pCookie
)
abstract PreCreateForOwner : 
        pUnkOwner:Object * 
        ppUnkInner:Object byref * 
        pCookie:uint32 byref -> int
function PreCreateForOwner(
    pUnkOwner : Object, 
    ppUnkInner : Object, 
    pCookie : uint
) : int

Parameters

  • pUnkOwner
    Type: Object

    [in] Pointer to an IUnknown owner object.

  • ppUnkInner
    Type: Object%

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

  • pCookie
    Type: UInt32%

    [out] Pointer to a cookie object.

Return Value

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

Remarks

COM Signature

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.

.NET Framework Security

See Also

Reference

IVsOwnedProjectFactory Interface

Microsoft.VisualStudio.Shell.Interop Namespace