次の方法で共有


IVsInvisibleEditor.GetDocData(Int32, Guid, IntPtr) Method

Definition

Obtains the document data for the file "under edit" by this editor object.

public:
 int GetDocData(int fEnsureWritable, Guid % riid, [Runtime::InteropServices::Out] IntPtr % ppDocData);
public int GetDocData (int fEnsureWritable, ref Guid riid, out IntPtr ppDocData);
abstract member GetDocData : int * Guid * nativeint -> int
Public Function GetDocData (fEnsureWritable As Integer, ByRef riid As Guid, ByRef ppDocData As IntPtr) As Integer

Parameters

fEnsureWritable
Int32

BOOLEAN indicating whether the document data is writable.

riid
Guid

GUID of the editor object.

ppDocData
IntPtr

nativeint

Pointer to the document data.

Returns

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

Remarks

COM Signature

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.

Applies to