[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

ocassional application crash

Jozsef Bekes

5/28/2007 8:52:00 AM

Hello All,

I have a mainly native c++ application that has a very simple module written
in C# dll with a very elementary
dialog GUI. The C# dll is accessed by an exported COM interface, so I call
CreateInstance, and after using the
dialog I call Release on the interface. This C# module is loaded only when
the user wants to access its features.
When we try to load it several times, in a non predictable manner during dll
load, an error pops up saying that the
application requested the runtime to terminate in an unusual way. The native
part of the application is usable as
long as we do not push OK on the error message. When we push ok, the process
dies.
I have attached windbg, and after investigating the call stack, I noticed
that the problem seems to be coming from
function ShowDialog() :

0:000> ~*e !clrstack
Thread 0
ESP EIP
0012ed14 7c90eb94 [FRAME: InlinedCallFrame]
0012ecfc 7b82dcfe [DEFAULT] [hasThis] Boolean

System.Windows.Forms.Application/ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPu

shMessageLoop(I4,I4,I4)
0012ed94 7b82d6af [DEFAULT] [hasThis] Void

System.Windows.Forms.Application/ThreadContext.RunMessageLoopInner(I4,Class

System.Windows.Forms.ApplicationContext)
0012edd0 7b82d3cd [DEFAULT] [hasThis] Void
System.Windows.Forms.Application/ThreadContext.RunMessageLoop(I4,Class

System.Windows.Forms.ApplicationContext)
0012edfc 7b87d8a4 [DEFAULT] Void
System.Windows.Forms.Application.RunDialog(Class System.Windows.Forms.Form)
0012ee0c 7b8fc1f1 [DEFAULT] [hasThis] ValueClass
System.Windows.Forms.DialogResult

System.Windows.Forms.Form.ShowDialog(Class
System.Windows.Forms.IWin32Window)
0012eef4 7b8fbd38 [DEFAULT] [hasThis] ValueClass
System.Windows.Forms.DialogResult

System.Windows.Forms.Form.ShowDialog()
0012eef8 09490836 [DEFAULT] [hasThis] Void

Project1.MyClass.Start(Boolean,Boolean,I4,I4,I4,I4,I4,I4,Boolean,Boolean,Boolean,String,String,String,I4)
at [+0x2ae] [+0x170] C:\temp\MyClass.cs:155
0012f0d4 79206069 [FRAME: ComMethodFrame]

This problem produces this eventlog entry:
Faulting application MyNativeApp.exe, version 2.1.0.1, faulting module
msvcr80.dll, version 8.0.50727.42, fault address 0x0000461a.

If you have any clue what can cause this problem, please let me know.

Thank you & best regards,
Jozsi