ATL Browser Crash On Stop Method 
Author Message
 ATL Browser Crash On Stop Method

I am building a custom web interface derived from Microsoft's ATL
Browser sample ( http://www.*-*-*.com/ ).
 So far, all my modifications have gone well except for a few strange
cases.  When I run my "custom browser" on a machine with Internet
Explorer 5.0.x (any patch level) installed, the browser crashes when I
call m_spWebBrowser->Stop() or m_spWebBrowser->Refresh() from my own
functions.  The browser does *not* crash however, when these methods
are called from the menus via OnViewStop() or OnViewRefresh().  I
cannot distinguish the difference between how the stop and refresh
methods are being called.  If my functions call OnViewStop/Refresh
directly, the crash still occurs.  Anyone have any ideas?


Mon, 07 Mar 2005 03:18:30 GMT  
 ATL Browser Crash On Stop Method
Are you by chance spawning wroker threads?

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> I am building a custom web interface derived from Microsoft's ATL
> Browser sample (http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=...).
>  So far, all my modifications have gone well except for a few strange
> cases.  When I run my "custom browser" on a machine with Internet
> Explorer 5.0.x (any patch level) installed, the browser crashes when I
> call m_spWebBrowser->Stop() or m_spWebBrowser->Refresh() from my own
> functions.  The browser does *not* crash however, when these methods
> are called from the menus via OnViewStop() or OnViewRefresh().  I
> cannot distinguish the difference between how the stop and refresh
> methods are being called.  If my functions call OnViewStop/Refresh
> directly, the crash still occurs.  Anyone have any ideas?



Mon, 07 Mar 2005 06:26:06 GMT  
 ATL Browser Crash On Stop Method
Yes I am actually.

It's a very weird set up.  I won't go into great detail, but I have a
thread that listens on a socket for commands from a remote machine.
(The project is for a training environment where an instructor could
control the browser.  Don't ask - I just work here.  :)  Of course
when a command is received, calls are made to the appropriate
method(s) on the browser.  Seems to work flawlessly on IE5.5x+, not to
mention the built-in ATL Browser code's menus call Stop and Refresh
just fine on IE5.0x.

Quote:

> Are you by chance spawning wroker threads?

> --
> =========================
> ============
> Alexander Nickolov
> Microsoft MVP [VC], MCSD

> MVP VC FAQ: http://www.mvps.org/vcfaq
> =========================
> ============



> > I am building a custom web interface derived from Microsoft's ATL
> > Browser sample
> (http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/
> downloads/samples/internet/browser/simple atlbrowser/default.asp).
> >  So far, all my modifications have gone well except for a few strange
> > cases.  When I run my "custom browser" on a machine with Internet
> > Explorer 5.0.x (any patch level) installed, the browser crashes when I
> > call m spWebBrowser->Stop() or m spWebBrowser->Refresh() from my own
> > functions.  The browser does *not* crash however, when these methods
> > are called from the menus via OnViewStop() or OnViewRefresh().  I
> > cannot distinguish the difference between how the stop and refresh
> > methods are being called.  If my functions call OnViewStop/Refresh
> > directly, the crash still occurs.  Anyone have any ideas?



Mon, 07 Mar 2005 21:40:22 GMT  
 ATL Browser Crash On Stop Method
Then you are violating the COM threading model rules. You must
only call the interfaces from their COM apartment - the main thread's
STA where the objects have been created. Before you jump to the
idea of using MTA, let me state clearly that you _cannot_ do so.
An ActiveX Control is mandatorily hosted on an STA thread. You
can marshal the control's interface to another apartment though.
You need to create that second apatment in your worker thread too.
MTA is probably a good choice for the worker thread.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

Quote:

> Yes I am actually.

> It's a very weird set up.  I won't go into great detail, but I have a
> thread that listens on a socket for commands from a remote machine.
> (The project is for a training environment where an instructor could
> control the browser.  Don't ask - I just work here.  :)  Of course
> when a command is received, calls are made to the appropriate
> method(s) on the browser.  Seems to work flawlessly on IE5.5x+, not to
> mention the built-in ATL Browser code's menus call Stop and Refresh
> just fine on IE5.0x.


> > Are you by chance spawning wroker threads?

> > --
> > =========================
> > ============
> > Alexander Nickolov
> > Microsoft MVP [VC], MCSD

> > MVP VC FAQ: http://www.mvps.org/vcfaq
> > =========================
> > ============



> > > I am building a custom web interface derived from Microsoft's ATL
> > > Browser sample
> > (http://msdn.microsoft.com/downloads/samples/internet/default.asp?url=/
> > downloads/samples/internet/browser/simple atlbrowser/default.asp).
> > >  So far, all my modifications have gone well except for a few strange
> > > cases.  When I run my "custom browser" on a machine with Internet
> > > Explorer 5.0.x (any patch level) installed, the browser crashes when I
> > > call m spWebBrowser->Stop() or m spWebBrowser->Refresh() from my own
> > > functions.  The browser does *not* crash however, when these methods
> > > are called from the menus via OnViewStop() or OnViewRefresh().  I
> > > cannot distinguish the difference between how the stop and refresh
> > > methods are being called.  If my functions call OnViewStop/Refresh
> > > directly, the crash still occurs.  Anyone have any ideas?



Tue, 08 Mar 2005 02:21:56 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. STOP 0x50 (E0800004,0,0,0) crash while debugging

2. How to Stop Derived Class from overriding base class method

3. Microsoft Web Browser ActiveX Crashes

4. MS Web Browser ActiveX Crashes

5. Web Browser Crashing on exit

6. Browser's Font Method

7. A problem about stop NT service exe in ATL

8. ATL Dialog Template - Modal/Modeless Tab Stop Behaviour

9. COM client crashes calling COM method

10. ATL Service - Sporadically does not report SERVICE STOP in event log

11. Atl Dll events stop in VB IDE after error triggered

12. ATL Wizard stops working in VC++ 6

 

 
Powered by phpBB® Forum Software