共用方式為


IVsOwnedProjectFactory.InitializeForOwner Method

Called by the project owner to tell the owned project to do all its initialization.

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

Syntax

'宣告
Function InitializeForOwner ( _
    pszFilename As String, _
    pszLocation As String, _
    pszName As String, _
    grfCreateFlags As UInteger, _
    ByRef iidProject As Guid, _
    cookie As UInteger, _
    <OutAttribute> ByRef ppvProject As IntPtr, _
    <OutAttribute> ByRef pfCanceled As Integer _
) As Integer
'用途
Dim instance As IVsOwnedProjectFactory
Dim pszFilename As String
Dim pszLocation As String
Dim pszName As String
Dim grfCreateFlags As UInteger
Dim iidProject As Guid
Dim cookie As UInteger
Dim ppvProject As IntPtr
Dim pfCanceled As Integer
Dim returnValue As Integer

returnValue = instance.InitializeForOwner(pszFilename, _
    pszLocation, pszName, grfCreateFlags, _
    iidProject, cookie, ppvProject, pfCanceled)
int InitializeForOwner(
    string pszFilename,
    string pszLocation,
    string pszName,
    uint grfCreateFlags,
    ref Guid iidProject,
    uint cookie,
    out IntPtr ppvProject,
    out int pfCanceled
)
int InitializeForOwner(
    [InAttribute] String^ pszFilename, 
    [InAttribute] String^ pszLocation, 
    [InAttribute] String^ pszName, 
    [InAttribute] unsigned int grfCreateFlags, 
    [InAttribute] Guid% iidProject, 
    [InAttribute] unsigned int cookie, 
    [OutAttribute] IntPtr% ppvProject, 
    [OutAttribute] int% pfCanceled
)
abstract InitializeForOwner : 
        pszFilename:string * 
        pszLocation:string * 
        pszName:string * 
        grfCreateFlags:uint32 * 
        iidProject:Guid byref * 
        cookie:uint32 * 
        ppvProject:IntPtr byref * 
        pfCanceled:int byref -> int 
function InitializeForOwner(
    pszFilename : String, 
    pszLocation : String, 
    pszName : String, 
    grfCreateFlags : uint, 
    iidProject : Guid, 
    cookie : uint, 
    ppvProject : IntPtr, 
    pfCanceled : int
) : int

Parameters

  • pszFilename
    Type: System.String
    [in] Pointer to a null terminated string containing the filename.
  • pszLocation
    Type: System.String
    [in] Pointer to a null terminated string containing the location.
  • pszName
    Type: System.String
    [in] Pointer to a null terminated string containing the name.
  • iidProject
    Type: System.Guid%
    [in] Specifies iidProject.
  • cookie
    Type: System.UInt32
    [in] Cookie identifying the owned project.
  • pfCanceled
    Type: System.Int32%
    [out] Pointer to a flag indicating canceled.

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::InitializeForOwner(
   [in] LPCOLESTR pszFilename,
   [in] LPCOLESTR pszLocation,
   [in] LPCOLESTR pszName,
   [in] VSCREATEPROJFLAGS grfCreateFlags,
   [in] REFIID iidProject,
   [in] VSOWNEDPROJECTOBJECT cookie,
   [out, iid_is(iidProject)] void **ppvProject,
   [out] BOOL *pfCanceled
);

Called by the owner to tell the owned project to do all its initialization. The owned project should do all its CreateProject work in here. The cookie parameter is just the cookie that the owned project passed back in PreCreateForOwner. This allows the owned project to create its project object cookie: additional parameter over CreateProject.

.NET Framework Security

See Also

Reference

IVsOwnedProjectFactory Interface

IVsOwnedProjectFactory Members

Microsoft.VisualStudio.Shell.Interop Namespace