Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

[Possible glitch/bug in COM-.Net interop] Windows Form with IE Webbrowser control throws Unhandled e
We have a windows application(MDI) written in C#.Net, which has an IE
Webbrowser control embedded in the page. Dialog opened could be a .Net
form with a web browser control or can be an independent IE window
opened from the web application hosted in the browser control of the
parent windows form. This application runs fine for a good 4-5 hours
and then crashes after throwing exceptions, which seem to be coming
from the COM component. We are primarily observing 3 kinds of
exceptions before the application crashes. I went through a few
knowledgebases and did not find a solution which would be applicable to
us. We are not able to recreate these issues on our development or
testing boxes. I used perfmon counters to see the behavior of the
process. Number of GC handles increased before the crash. I do not
understand why the number would increase all of a sudden and then just
crash. It seems like in some cases either CCW is invalid or RCW is
invalid due to something funky in GC.

--> We are not using Application.EnableVisualStyles
--> We are not invoking GC.Collect()
--> We are releasing the COM object in the dispose method of the
windows form.
--> To the best of my knowledge, we are reregistering the events of the
browser everytime.
--> We have activex controls in our webapplication.
--> Windows form has a datagrid with custom column style.

Any suggestions?

Exception 1:
Exception Message : COM object that has been separated from its
underlying RCW can not be used. **Exception Stack Trace :    at
SHDocVw.IWebBrowser2.get_Document()
at AxSHDocVw.AxWebBrowser.get_Document()

Exception 2:
An unhandled exception of type 'System.NullReferenceException' occurred
in system.windows.forms.dll

Additional information: Object reference not set to an instance of an
object.

Unhandled Exception: System.NullReferenceException: Object reference
not set to an instance of an object.
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)

Exception 3:
************** Exception Text **************
System.Runtime.InteropServices.SEHException: External component has
thrown an exception.
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr
wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmUpdateUIState(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.ParkingWindow.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)


I was wondering if it is a bug or an issue with .Net-COM
Interoperability. Did anyone have similar issues? Any information in
this regard would be pretty helpful.

Thanks,
VC.


Report this thread to moderator Post Follow-up to this message
Old Post
programmingq@gmail.com
10-08-05 02:57 AM


Re: [Possible glitch/bug in COM-.Net interop] Windows Form with IE Webbrowser control throws Unhandl
I am having the same problem with a C#/.Net app. The embedded webbrowser con
trol seems to cause unhandled exceptions of the same types you listed.  Some
times our application closes completely. I can not seem to find a solution. 
Have you found one?


[QUOTE]Originally posted by programmingq@gmail.com 
[B]We have a windows application(MDI) written in C#.Net, which has an IE
Webbrowser control embedded in the page. Dialog opened could be a .Net
form with a web browser control or can be an independent IE window
opened from the web application hosted in the browser control of the
parent windows form. This application runs fine for a good 4-5 hours
and then crashes after throwing exceptions, which seem to be coming
from the COM component. We are primarily observing 3 kinds of
exceptions before the application crashes. I went through a few
knowledgebases and did not find a solution which would be applicable........

Report this thread to moderator Post Follow-up to this message
Old Post
tef
01-27-06 06:48 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

C# archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:17 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.