Partager via


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

'Declaration
Function SetUntitledDocPath ( _
    pszDocDataPath As String _
) As Integer
int SetUntitledDocPath(
    string pszDocDataPath
)
int SetUntitledDocPath(
    [InAttribute] String^ pszDocDataPath
)
abstract SetUntitledDocPath : 
        pszDocDataPath:string -> int
function SetUntitledDocPath(
    pszDocDataPath : String
) : int

Parameters

  • pszDocDataPath
    Type: String

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

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

IVsPersistDocData2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace