IVsInvisibleEditor::GetDocData Method (Int32, Guid, IntPtr)
Obtains the document data for the file "under edit" by this editor object.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int GetDocData( int fEnsureWritable, [InAttribute] Guid% riid, [OutAttribute] IntPtr% ppDocData )
Parameters
- fEnsureWritable
-
Type:
System::Int32
BOOLEAN indicating whether the document data is writable.
- riid
-
Type:
System::Guid
GUID of the editor object.
- ppDocData
-
Type:
System::IntPtr
Pointer to the document data.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsInvisibleEditor::GetDocData( [in] BOOL fEnsureWritable, [in] REFIID riid, [out, iid_is(riid)] void **ppDocData );
If the file is not already open, the editor factory registered with this editor is used; the default text-file loader is used if NULL was registered in the editor factory. If the file is already in the RDT, it will simply be query interfaced for the given interface and returned. Editors should use this function each time they need access to the document data, as opposed to caching the document data object, since in that case it may get removed from the RDT and re-loaded into a new document data object. If the caller intends to modify the document, they should pass TRUE for fEnsureWritable, which queries the user for checking the file out as appropriate if it is under source code control.