IPersistFileFormat::GetCurFile Method (String^, UInt32)
Returns the path to an object's current working file, or, if there is not a current working file, the object's default file name prompt.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int GetCurFile( [OutAttribute] String^% ppszFilename, [OutAttribute] unsigned int% pnFormatIndex )
Parameters
- ppszFilename
-
Type:
System::String^
[out] Pointer to the file name. If the object has a valid file name, the file name is returned as the ppszFilename out parameter. If the object is in the untitled state, null is returned as the ppszFilename out parameter.
Note This result differs from that of the standard GetCurFile method, which returns S_FALSE and a "Save As" prompt string.
- pnFormatIndex
-
Type:
System::UInt32
[out] Value that indicates the current format of the file. This value is interpreted as a zero-based index into the list of formats, as returned by a call to GetFormatList. An index value of zero indicates the first format, 1 the second format, and so on. If the object supports only a single format, it returns zero. Subsequently, it returns a single element in its format list through a call to GetFormatList.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From fpstfmt.idl:
HRESULT IPersistFileFormat::GetCurFile( [out] LPOLESTR *ppszFilename, [out] DWORD *pnFormatIndex );
This method is similar to GetCurFile. In order to save the current file in the current format, call GetCurFile to retrieve the current format index value in order to pass it properly to the Save method.