This documentation is archived and is not being maintained.

IVsProjectSpecialFiles.GetFile Method

Retrieves the item identifier, name, and path of a special project file.

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

int GetFile (
	[InAttribute] int fileID,
	[InAttribute] uint grfFlags,
	out uint pitemid,
	out string pbstrFilename
int GetFile (
	/** @attribute InAttribute() */ int fileID, 
	/** @attribute InAttribute() */ UInt32 grfFlags, 
	/** @attribute OutAttribute() */ /** @ref */ UInt32 pitemid, 
	/** @attribute OutAttribute() */ /** @ref */ String pbstrFilename
JScript does not support passing value-type arguments by reference.



[in] The type of special file. A value from the __PSFFILEID enumeration.


[in] Bit flags indicating whether or not to create the file, or whether the full path has been provided. A value from the __PSFFLAGS enumeration.


[out] Pointer to the VSITEMID of the special file.


[out] Pointer to a string containing the name of the file and, optionally, the full path.

Return Value

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From vsshell.idl:


HRESULT IVsProjectSpecialFiles::GetFile(
   [in] PSFFILEID fileID, 
   [in] PSFFLAGS grfFlags, 
   [out] VSITEMID* pitemid, 
   [out] BSTR* pbstrFilename