title: How to use IDocumentEvent, IDOMEvent and IEventTarget in C++
body: <p>I have a MFC application (CDialog) controlling an IE11 window (page loaded).</p>
  
  <p>HTML Source:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function upperCase(x)
  {
   var y=document.getElementById(x).value
   document.getElementById(x).value=y.toUpperCase()
  }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  Enter your name: &lt;input type="text" id="fname" onchange="upperCase(this.id)"&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>In IE8 I can run 'OnChange' event with createEventObject and fireevent. But the same code can't be used on IE11.</p>
  
  <p>I know for IE11 an event is created with <a href="https://msdn.microsoft.com/en-us/library/jj192236(v=vs.85).aspx" rel="nofollow">IDocumentEvent::createEvent</a> and fired with <a href="https://msdn.microsoft.com/en-us/library/hh773207(v=vs.85).aspx" rel="nofollow">IEventTarget::dispatchEvent</a>.</p>
  
  <p>But how to use them? C++ sample code not found in MSDN.</p>
  
  <p>IDE: Visual Studio 2015 Community.</p>