共用方式為


IVsPersistDocData.SetUntitledDocPath Method

Sets the initial name (or path) for unsaved, newly created document data.

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

Syntax

'宣告
Function SetUntitledDocPath ( _
    pszDocDataPath As String _
) As Integer
'用途
Dim instance As IVsPersistDocData
Dim pszDocDataPath As String
Dim returnValue As Integer

returnValue = instance.SetUntitledDocPath(pszDocDataPath)
int SetUntitledDocPath(
    string pszDocDataPath
)
int SetUntitledDocPath(
    [InAttribute] String^ pszDocDataPath
)
abstract SetUntitledDocPath : 
        pszDocDataPath:string -> int 
function SetUntitledDocPath(
    pszDocDataPath : String
) : int

Parameters

  • pszDocDataPath
    Type: System.String
    [in] String indicating the path of the document. Most editors can ignore this parameter. It exists for historical reasons.

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 IVsPersistDocData::SetUntitledDocPath(
   [in] LPCOLESTR pszDocDataPath
);

SetUntitledDocPath is called by all projects after a new document instance is created.

Editors use the same CreateInstance/InitNew design pattern of standard COM objects.

Editors can use this method to perform one-time initializations that are required after a new document instance was created through a call to CreateEditorInstance with a parameter of CEF_CLONEFILE.

.NET Framework Security

See Also

Reference

IVsPersistDocData Interface

IVsPersistDocData Members

Microsoft.VisualStudio.Shell.Interop Namespace