Attach BHO to running instance of IE |
| Sanjay Verma replied to nishant sagar at 05-Jul-08 01:24 |
The BHO will attach itself to each instance of IE. Each IE instance may be in a separate process (and a DLL has to be loaded by each process) or several instances of IE may run in the same process. This is very important to understand when dealing with global variables. When several IE instances happen to run in the same process, they load the BHO DLL just once, though each still creates its own instance of a BHO object. Global variables are shared between all BHO instances running in the same process, so you have to use some kind of synchronization when modifying these variables. If you wish to test this, you can launch IE in a separate process each time you launch IE from the desktop, or you can launch another instance of IE in the same process by right-clicking on a link and selecting 'Open in New Window'.
By the way, note the call to AtlMessageBox in EditOptions(). This is an ATL function that displays a normal message box, but has the added benefit of taking string IDs instead of quoted strings. By placing the strings in the resource file it will be easier to internationalize Popup Blocker at a later date (maybe version 3).
See the following article for more details ::
http://www.codeproject.com/KB/shell/popupblocker2.aspx
http://msdn.microsoft.com/en-us/library/bb250436.aspx
Hope it helps.
|
| Biography |
| Asp.Net Developer |
|