Friday, September 14, 2012 6:14 AM
Using C++, I'm listening for IVsTextLinesEvents events, and it works just fine for most file types (C++/C#/VB). However for HTML and ASPX files, I can't find a connection point, so I can't advise. A simplified example (with no error handling) is below. Is it possible to get these events for these file types? Thanks!
void TextEventsListener::Connect(VSCOOKIE docCookie)
CComPtr<IVsRunningDocumentTable> rdt = GetIVsRunningDocumentTable();
rdt->GetDocumentInfo(docCookie, NULL, NULL, NULL, NULL, NULL, NULL, &buffer);
// This line fails for HTML and ASPX files
pt->Advise((IVsTextLinesEvents *)this, &mLinesEventCookie);
Monday, September 17, 2012 5:42 AMModerator
Monday, September 17, 2012 9:50 PMModerator
The HTML/ASPX stuff implement IVsTextBufferProvider, you need to cast the buffer object returned from the RDT to that, ask it for the real buffer and then go down the IConnectionPointContianer route.
- Marked As Answer by mark.deggeller.wt Tuesday, September 18, 2012 3:36 AM
Tuesday, September 18, 2012 3:36 AM
Thanks, Ryan. That did it!