I'm writing a HTML editor application in C++/CLI based on IE7.0 using CHTMLEditView as an MFC base class. I'm a newbie to this technology although an old hand at programming. I'm trying to detect changes in the main document after I've set contentEditable=TRUE on several attributes and typed into them. To do this, I created a class that implemented IHTMLChangeSink and bound an object of the class as follows from the OnDocumentComplete override of HTMLEditView. The problem is that although the call to CreateChangeLog seems to work, nothing I type fires Notify. The really bizarre aspect to all of this is that when I originally tried to implement this in VB.NET using a managed class, it all worked!
Also, is there any documentation on how to use IHTMLChangeLog so Undo events can be trapped and intercepted The existing MSHTML documentation is so sparse. Any chance of opening this up to Community Content so if MS people don't have time to plug the gaps, others can
HRESULT hr;
if (m_pMarkupContainer2){
READYSTATE state = GetReadyState();
if (state==READYSTATE_COMPLETE){
CNativeChangeSink* mySink =
new CNativeChangeSink(this);hr = m_pMarkupContainer2->CreateChangeLog((IHTMLChangeSink*)mySink, &m_pChangeLog, TRUE, TRUE);
ASSERT(SUCCEEDED(hr));
IHTMLChangeSink* tempSink;
mySink->QueryInterface(IID_IHTMLChangeSink, (
void**) &tempSink);hr=m_pMarkupContainer2->RegisterForDirtyRange(tempSink, &mpdwRangeCookie);
tempSink->Release();
ASSERT(SUCCEEDED(hr));
}
}