We have embedded Mozilla 1.3.1 in an MFC app. It runs fine in most cases. While testing under Windows 98, however, we have encountered a very regular crash bug associated with calls to the Win32 SetFocus API. It's a bit mysterious. It doesn't happen all the time--not every SetFocus call causes it. SetFocus may not be the cause, but SetFocus does show up somewhere in every stack trace. Most of the time the SetFocus call is in MFC code, not in any code we wrote. We don't see this problem under WinXP or Win2000. (We aren't yet able to test on Win95 for other reasons.) Although Mozilla is usually nowhere in the stack trace, the crash occurs only if Gecko is loaded into memory. Our UI is up for a while before we call NS_InitEmbedding and that part of the code never crashes.
All the stack traces end like this: 0030003a() KERNEL32.DLL!bff7363b() KERNEL32.DLL!bff94407() KERNEL32.DLL!bff719b8() USER32.DLL!bff53e0f() USER32.DLL!bff524b4() KERNEL32.DLL!bff741f7() [some call to SetFocus here] Here's a typical complete stack trace: 0030003a() KERNEL32.DLL!bff7363b() KERNEL32.DLL!bff94407() KERNEL32.DLL!bff719b8() USER32.DLL!bff53e0f() MyApp.exe!CWnd::AttachControlSite(CHandleMap * pMap=0x00c07000) Line 445 + 0x16 USER32.DLL!bff524b4() KERNEL32.DLL!bff741f7() MyApp.exe!CView::OnActivateView(int bActivate=0x00000001, CView * pActivateView=0x01663a90, CView * __formal=0x01663d60) Line 234 [CView::OnActivateview calls SetFocus, by the way] MyApp.exe!CFrameWnd::SetActiveView(CView * pViewNew=0x01663a90, int bNotify=0x00000001) Line 1210 MyApp.exe!CView::OnMouseActivate(CWnd * pDesktopWnd=0x016629f0, unsigned int nHitTest=0x00000001, unsigned int message=0x00000201) Line 267 MyApp.exe!CWnd::OnWndMsg(unsigned int message=0x00000021, unsigned int wParam=0x0000013c, long lParam=0x02010001, long * pResult=0x00c0f300) Line 2005 + 0x2a MyApp.exe!CWnd::WindowProc(unsigned int message=0x00000021, unsigned int wParam=0x0000013c, long lParam=0x02010001) Line 1745 + 0x1e MyApp.exe!AfxCallWndProc(CWnd * pWnd=0x01663a90, HWND__ * hWnd=0x0000034c, unsigned int nMsg=0x00000021, unsigned int wParam=0x0000013c, long lParam=0x02010001) Line 241 + 0x1a MyApp.exe!AfxWndProc(HWND__ * hWnd=0x0000034c, unsigned int nMsg=0x00000021, unsigned int wParam=0x0000013c, long lParam=0x02010001) Line 389 KERNEL32.DLL!bff7363b() KERNEL32.DLL!bff94407() KERNEL32.DLL!bff719b8() KERNEL32.DLL!bff7b9c5() MyApp.exe!ATL::CTrace::TraceV(const char * pszFileName=0x5defbcdc, int nLine=0x000279c4, unsigned long dwCategory=0x03db853e, unsigned int nLevel=0x0000177f, const char * pszFmt=0x02010001, char * args=0x0021013c) Line 123 + 0x7 MyApp.exe!ATL::CTraceFileAndLineInfo::operator()(unsigned long dwCategory=0x013c0201, unsigned int nLevel=0x05480021, const char * pszFmt=0x00210548, ...) Line 163 + 0x27 16a73847() MyApp.exe!CWnd::WindowProc(unsigned int message=0x00000021, unsigned int wParam=0x0000013c, long lParam=0x02010001) Line 1746 + 0x1a MyApp.exe!AfxCallWndProc(CWnd * pWnd=0x017301c0, HWND__ * hWnd=0x00000548, unsigned int nMsg=0x00000021, unsigned int wParam=0x0000013c, long lParam=0x02010001) Line 241 + 0x1a MyApp.exe!AfxWndProc(HWND__ * hWnd=0x00000548, unsigned int nMsg=0x00000021, unsigned int wParam=0x0000013c, long lParam=0x02010001) Line 389 KERNEL32.DLL!bff7363b() KERNEL32.DLL!bff94407() KERNEL32.DLL!bff719b8() _______________________________________________ mozilla-embedding mailing list mozilla-embedding@mozilla.org http://mail.mozilla.org/listinfo/mozilla-embedding