RichTextBox in WPF raised InvalidComObjectException in release build application


i got invalidcomobjectexception on exit on release build application. if don't use richtextbox, don't see crash. in debug build application, don't see crash. on release machine, if call currentdispather.invokeshutdown won't eliminate crash.

my main appliation unmanaged mfc. wpf control embedded in cview in mfc application.

any idea or suggestion? thanks.

the solution worked me involved processing pending messages on thread's message queue before exitinstance.  cross apartment lrpc calls made between richedit control , dependent com component introducing reentrancy on thread's queue, allowing queued messages ("milchannelnotify" messages) processed after main thread had called couninitialize.

------------------------------------------
i've encountered same exception under similar conditions (native mfc app hosting wpf control within cwnd).  initial native exception, resulting the stack shown below, eventually causes same clr execption described orriginal poster.  i've had numerous termination problems in past native app hosting managed code, but have resolved them until introduction of wpf within application.  i'm interested in guidelines on how a native application should shutdown avoid exceptions related managed code (i.e. stop dispatcher, unload app domain?).  have not come across useful on topic.  i'd know how symbols wpf related assemblies, not seem coming down microsoft symbol server.

childebp retaddr  args child             
0045ecbc 6d2b8e89 e06d7363 00000001 00000003 kernel32!raiseexception+0x58 (fpo: [non-fpo])
0045ecf4 6b549a49 0045ed58 6b8331e0 de76b0a8 msvcr80!_cxxthrowexception+0x46 (fpo: [non-fpo])
0045ed24 6b4bc2e9 0000001d 000017d9 00000000 mscorwks!realcomplusthrow+0xfc (fpo: [non-fpo])
0045ed60 6b430550 07399f7c de76b39c 0737e848 mscorwks!rcwholder::init+0x55 (fpo: [non-fpo])
0045ee10 6b3ae7da 09356be4 69f8e0ac 0737e848 mscorwks!comobject::supportsinterface+0x83 (fpo: [non-fpo])
0045ee4c 6b3ae88d 09356be4 69f8e0ac de76b374 mscorwks!objisinstanceof+0xbc (fpo: [non-fpo])
*** warning: unable verify checksum c:\windows\assembly\nativeimages_v2.0.50727_32\presentationframewo#\29eb51a21ce62ed759b162307bd65e32\presentationframework.ni.dll
0045eef8 0c91d096 09428970 094285ec 00000000 mscorwks!jitutil_isinstanceofany+0xab (fpo: [non-fpo])
*** warning: unable verify checksum c:\windows\assembly\nativeimages_v2.0.50727_32\windowsbase\c049bc39cb33f7459936a689484285d6\windowsbase.ni.dll
0045ef30 69db61fa 09428970 00000001 00000001 presentationframework_ni+0xa0d096
0045ef4c 69db60ea 00000001 09428970 00000000 windowsbase_ni+0x961fa
0045ef8c 69db42b4 00000000 00000001 09428970 windowsbase_ni+0x960ea
0045efb0 69db912d 00000000 00000001 09428970 windowsbase_ni+0x942b4
0045efe8 69db90b8 0942bf6c 67fe5681 00000000 windowsbase_ni+0x9912d
0045f000 6b321b4c ffffffe2 00000000 0045f090 windowsbase_ni+0x990b8
0045f010 6b3321b9 0045f0e0 00000000 0045f0b0 mscorwks!calldescrworker+0x33
0045f090 6b346531 0045f0e0 00000000 0045f0b0 mscorwks!calldescrworkerwithhandler+0xa3 (fpo: [non-fpo])
0045f1cc 6b346564 67f31ff0 0045f300 0045f220 mscorwks!methoddesc::calldescr+0x19c (fpo: [non-fpo])
0045f1e8 6b346582 67f31ff0 0045f300 0045f220 mscorwks!methoddesc::calltargetworker+0x1f (fpo: [non-fpo])
0045f200 6b41a259 0045f220 de76ae40 0737e848 mscorwks!methoddesccallsite::callwithvaluetypes_retargslot+0x1a (fpo: [non-fpo])
0045f3cc 6b41a3ae 0045f45c de76a9f0 0942bfb4 mscorwks!executecodewithguaranteedcleanuphelper+0x9f (fpo: [non-fpo])
*** warning: unable verify checksum c:\windows\assembly\nativeimages_v2.0.50727_32\mscorlib\17f572b09facdc5fda9431558eb7a26e\mscorlib.ni.dll
0045f47c 67fe5577 0045f420 0942aa04 0925f46c mscorwks!reflectioninvocation::executecodewithguaranteedcleanup+0x10f (fpo: [non-fpo])
0045f498 67fd01c5 0942a998 00000000 0942a998 mscorlib_ni+0x235577
0045f4b0 69db8ff3 0942a998 00000000 00000000 mscorlib_ni+0x2201c5
0045f4ec 69db3957 6b7f8148 ffffffff 6b34b317 windowsbase_ni+0x98ff3
0045f5c8 69db3c43 00000000 00000000 09265118 windowsbase_ni+0x93957
0045f604 69db63de 09265814 00000000 00000000 windowsbase_ni+0x93c43
0045f650 69db630a 09265814 00000000 00000000 windowsbase_ni+0x963de
0045f670 69db61fa 092657fc 00000001 00000001 windowsbase_ni+0x9630a
0045f68c 69db60ea 00000001 092657fc 00000000 windowsbase_ni+0x961fa
0045f6cc 69db42b4 00000000 00000001 092657fc windowsbase_ni+0x960ea
0045f6f0 69db3411 00000000 00000001 092657fc windowsbase_ni+0x942b4
0045f72c 69db3360 00000001 092657fc 092657dc windowsbase_ni+0x93411
0045f75c 69db5a4c 092657fc 092657dc 044d286a windowsbase_ni+0x93360
0045f7ac 76568807 001604ac 0000c24c 00000000 windowsbase_ni+0x95a4c
0045f7d8 76568962 044d28aa 001604ac 0000c24c user32!internalcallwinproc+0x23
0045f850 76568aad 061660f4 044d28aa 001604ac user32!usercallwinproccheckwow+0x109 (fpo: [non-fpo])
0045f8b4 76568b00 044d28aa 00000000 0045fd6c user32!dispatchmessageworker+0x380 (fpo: [non-fpo])
0045f8c4 6f64a752 0045fd34 da32049f 00000000 user32!dispatchmessagew+0xf (fpo: [non-fpo])


.NET Framework  >  Common Language Runtime Internals and Architecture



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'