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

‘선언
Function PreCreateForOwner ( _
    pUnkOwner As Object, _
    <OutAttribute> ByRef ppUnkInner As Object, _
    <OutAttribute> ByRef pCookie As UInteger _
) As Integer
‘사용 방법
Dim instance As IVsOwnedProjectFactory
Dim pUnkOwner As Object
Dim ppUnkInner As Object
Dim pCookie As UInteger
Dim returnValue As Integer

returnValue = instance.PreCreateForOwner(pUnkOwner, _
    ppUnkInner, pCookie)
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: System.Object
    [in] Pointer to an IUnknown owner object.
  • ppUnkInner
    Type: System.Object%
    [out] Pointer to a pointer to an IUnknown inner object.

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 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

IVsOwnedProjectFactory Members

Microsoft.VisualStudio.Shell.Interop Namespace