Internet Explorer Events with Browser Control in MFC ? 
Author Message
 Internet Explorer Events with Browser Control in MFC ?

I'm having a battle with events in MFC/C++. Here is my problem.

In VB I have a form with a WebBrowser control on it.  I can do the following
code and catch all the events I need.

Private WithEvents WebDocEvents As HTMLDocument

Private Sub Form_Activate
    Set WebDocEvents = WebBrowser.Document
End Sub

Private Function WebDocEvents_onclick() As Boolean
    'Do my thing
End Function

My problem comes when I try to port this code to MFC C++.

I have my WebBrowser, I have opened a page, I can get the HTML Document
Interface, but I have no idea of how to implement a WithEvents equivalent or
anything similar that would do the job.

Can anyone shed any light on this for me ?

Thanks in advance,



Sat, 24 Nov 2001 03:00:00 GMT  
 Internet Explorer Events with Browser Control in MFC ?
Look at example IEHelper in MSDN. CHTMLView implements IWebBrowser2 and its
complete source is in MFC.

There are few examples at codeguru:
http://www.codeguru.com/internet/index.shtml

--
Ajay Kalra

Quote:

>I'm having a battle with events in MFC/C++. Here is my problem.

>In VB I have a form with a WebBrowser control on it.  I can do the
following
>code and catch all the events I need.

>Private WithEvents WebDocEvents As HTMLDocument

>Private Sub Form_Activate
>    Set WebDocEvents = WebBrowser.Document
>End Sub

>Private Function WebDocEvents_onclick() As Boolean
>    'Do my thing
>End Function

>My problem comes when I try to port this code to MFC C++.

>I have my WebBrowser, I have opened a page, I can get the HTML Document
>Interface, but I have no idea of how to implement a WithEvents equivalent
or
>anything similar that would do the job.

>Can anyone shed any light on this for me ?

>Thanks in advance,



Sat, 24 Nov 2001 03:00:00 GMT  
 Internet Explorer Events with Browser Control in MFC ?
This example gives me the standard events, like BeforeNavigate etc.  I can
get these events OK by using ClassWizard with a WebBrowser Control.

The ones I am really interested in are the keypress and doubleclick events,
but I haven't been able to find any examples where this is done !

I know you can do it, because I have done it in VB, but I am at a loss as to
how to do this in VC.

Carl.

Quote:

>Look at example IEHelper in MSDN. CHTMLView implements IWebBrowser2 and its
>complete source is in MFC.

>There are few examples at codeguru:
>http://www.codeguru.com/internet/index.shtml

>--
>Ajay Kalra




Sun, 25 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Serious problem with using AtlAxWin to host Internet Explorer Browser Control

2. Web Browser Control/Explorer Control/HTML Control

3. Problem trying to implement custom class factory for an Internet Explorer Browser Helper Object

4. Please help me again......about debugging together with browser Internet Explorer 4.0

5. Problem trying to implement custom class factory for an Internet Explorer Browser Helper Object

6. Internet Explorer Browser Class

7. Internet Explorer events

8. How to Fire Error Event to Internet Explorer?

9. internet explorer event sink problems:

10. sinking events in internet explorer and com

11. Getting Internet Explorer events

12. Method for handling events of Internet Explorer....

 

 
Powered by phpBB® Forum Software