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
'Usage
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.
- 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.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVsOwnedProjectFactory Interface