IVsTextView.Initialize(IVsTextLines, IntPtr, UInt32, INITVIEW[]) Method

Definition

Creates the view and allows clients to specify one or more TextViewInitFlags options.

C++
public:
 int Initialize(Microsoft::VisualStudio::TextManager::Interop::IVsTextLines ^ pBuffer, IntPtr hwndParent, System::UInt32 InitFlags, cli::array <Microsoft::VisualStudio::TextManager::Interop::INITVIEW> ^ pInitView);

Parameters

pBuffer
IVsTextLines

[in] Pointer to a text buffer object to attach the view to.

hwndParent
IntPtr

[in] Specifies a handle to the parent window.

InitFlags
UInt32

[in] Specifies view options. For a list of InitFlags values, see TextViewInitFlags.

pInitView
INITVIEW[]

[in] Pointer to the view you want to initialize.

Returns

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

Remarks

COM Signature

From textmgr.idl:

cpp#
HRESULT IVsTextView::Initialize(  
   [in] IVsTextLines *pBuffer,  
   [in] HWND hwndParent,  
   [in] DWORD InitFlags,  
   [in] const INITVIEW *pInitView  
);  

When you hook up your language service to the core text editor, the editor automatically provides you with a view, which it initializes. You only need to call Initialize to initialize a view that you created separately and hooked up later.

Applies to

Product Versions
Visual Studio SDK 2015, 2017, 2019, 2022