How to handle document events for Internet Explorer

  • Thread starter Thread starter Francis McGrath
  • Start date Start date
F

Francis McGrath

There is an article called How to handle document events in a Visual C++
application at http://support.microsoft.com/kb/815715/. It details how to do
this with the WebBrowswer object and briefly says "This information also
applies to handling document events in Visual C++ .NET 2003 or Visual C++
2005 when you automate Internet Explorer."

I was able to get it working for the WebBrowswer object, but I can't figure
out what I need to do different to get it to work with InternetExplorer.

I will admit that I am very new with limited experience, but if someone
could help me figure out how to convert this to IE, I'd really appreciate it.
 
An example can be found at www.codeproject.com/shell/AutomateShellWindow.asp

--
Sheng Jiang
Microsoft MVP in VC++
Francis McGrath said:
There is an article called How to handle document events in a Visual C++
application at http://support.microsoft.com/kb/815715/. It details how to do
this with the WebBrowswer object and briefly says "This information also
applies to handling document events in Visual C++ .NET 2003 or Visual C++
2005 when you automate Internet Explorer."

I was able to get it working for the WebBrowswer object, but I can't figure
out what I need to do different to get it to work with InternetExplorer.

I will admit that I am very new with limited experience, but if someone
could help me figure out how to convert this to IE, I'd really appreciate
it.
 
Thanks for the example. That seems like a very complicated way to do it. I
was hoping to find something simple, like in the example I sent.

What I'd like to do is:

private: InternetExplorer * ie ;
ie = new InternetExplorerClass();
ie->Visible = true;
ie->DocumentComplete += new
DWebBrowserEvents2_DocumentCompleteEventHandler(this, DocumentComplete);

And then have a function like:
private: System::Void DocumentComplete(System::Object * PDisp, VARIANT
FAR* URL)
{
MessageBox::Show(S"Page loaded.");
}

This is trying to do the same thing as the example, but this gives me error
C3352: 'void ...DocumentComplete(System::Object __gc *,VARIANT *)' : the
specified function does not match the delegate type 'void (System::Object
__gc *,System::Object __gc *__gc * )'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

event handling 1
tracking handle 2
Event Handlers 5
PDF Documents 7
Event handling in VC++ 2005 .NET 7
MDI Parent-Child Multiple Events Firing 0
C# event Handles 3
Use of event handling 6

Back
Top