2011-04-07 2 views
4

우리는 현미경에 연결된 WPF 응용 프로그램이 있습니다. 응용 프로그램에서 현미경의 대물 렌즈를 전환 할 수있는 시나리오가 있습니다. 우리가 할 때 현미경에 렌즈 교체를 알리는 하드웨어 호출이 있고 그 후에 UI가 업데이트되는 시나리오가 있습니다.System.Runtime.InteropServices.COMException (0x88980406)

Message = Exception from HRESULT: 0x88980406;Category: Critical;Priority: -1;EventId: 1; 
Timestamp: Wednesday, April 13, 2011 6:35:46 PM;Message: FullText = System.Runtime.InteropServices.COMException (0x88980406): Exception from HRESULT: 0x88980406 
at System.Windows.Media.Composition.DUCE.Channel.SyncFlush() 
at System.Windows.Media.Composition.DUCE.CompositionTarget.UpdateWindowSettings(ResourceHandle hCompositionTarget, RECT windowRect, Color colorKey, Single constantAlpha, MILWindowLayerType windowLayerType, MILTransparencyFlags transparencyMode, Boolean isChild, Boolean isRTL, Boolean renderingEnabled, Int32 disableCookie, Channel channel) 
at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable``1 channelSet) 
at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget) 
at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam) 
at System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg, IntPtr wparam, IntPtr lparam) 
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) 
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) 
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
at MS.Win32.UnsafeNativeMethods.SetWindowPos(HandleRef hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy, Int32 flags) 
at System.Windows.Interop.HwndSource.Resize(Size newSize) 
at System.Windows.Interop.HwndSource.OnLayoutUpdated(Object obj, EventArgs args) 
at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent() 
at System.Windows.ContextLayoutManager.UpdateLayout() 
at System.Windows.UIElement.UpdateLayout() 
at System.Windows.Interop.HwndSource.SetLayoutSize() 
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) 
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value) 
at System.Windows.Controls.Primitives.Popup.PopupSecurityHelper.SetWindowRootVisual(Visual v) 
at System.Windows.Controls.Primitives.Popup.SetRootVisualToPopupRoot() 
at System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall) 
at System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) 
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType) 
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal) 
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) 
at System.Windows.Data.BindingOperations.SetBinding(DependencyObject target, DependencyProperty dp, BindingBase binding) 
at System.Windows.Controls.Primitives.Popup.CreateRootPopup(Popup popup, UIElement child) 
at System.Windows.Controls.ToolTip.HookupParentPopup() 
at System.Windows.Controls.ToolTip.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) 
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType) 
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal) 
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) 
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Boolean value) 
at System.Windows.Controls.PopupControlService.RaiseToolTipOpeningEvent() 
at System.Windows.Controls.PopupControlService.OnRaiseToolTipOpeningEvent(Object sender, EventArgs e) 
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused) 
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) 
at System.Threading.ExecutionContext.runTryCode(Object userData) 
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) 
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
at System.Windows.Threading.DispatcherOperation.Invoke() 
at System.Windows.Threading.Dispatcher.ProcessQueue() 
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) 
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) 
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) 
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) 
at System.Windows.Threading.Dispatcher.Run() 
at System.Windows.Application.RunDispatcher(Object ignore) 
at System.Windows.Application.RunInternal(Window window) 
at System.Windows.Application.Run(Window window) 
at System.Windows.Application.Run() 

기계 구성은 다음과 같습니다 : 마이크로 소프트

우리는이 시나리오에 대한 스트레스 테스트를 실행하고 결국 PresentationCore.dll

호출 스택으로 소스와의

System.Runtime.InteropServices.COMException (0x88980406) 

있어 비스타 SP2.Net Framework 3.5

해결 방법에 대한 의견을 제공해주십시오.

+3

아니요, 안타깝게도 * 예외 사항 전체를 제공하지 않기 때문에 불가능합니다. –

+1

또한 Interop.HwndTarget을 사용하는 내 .NetFramework 4.0 프로젝트에서 발생합니다. 크기 조정시 예외가 발생합니다. –

+0

@BerndOtt, 방금 내 엉덩이를 구했어, 널 사랑해. – Tsury

답변

0

BerndOtt가 제안한 것처럼, 적어도 나를 위해, 이것은 HwndTarget의 크기가 변경되는 것과 관련이있었습니다.

나는 코드의 다음 두 줄을 주석 처리하고,이 문제는 이제 나를 위해 해결 :

HwndTarget hwndTarget = source.CompositionTarget; 
hwndTarget.RenderMode = RenderMode.SoftwareOnly; 

은 onLoaded 방법에 넣어, here을 입증한다.

+0

이 코드 줄은 어디에 두었습니까? –

+0

게시물을 편집했습니다. – Tsury

+0

감사합니다. 나는 그것을 한 번 시도해보고 잘하면 문제를 해결할 것입니다. 내 문제는 IE 내에서 화면을로드 할 수있는 xbap 통해 내 WPF 화면을로드하는 것입니다. 또한 winForms 기반에서 호스팅되는 여러 구성 요소를 사용합니다. 그래서 WPF 컨트롤 중 하나를이베이스에서 호스팅 할 수 있습니다. 이상한 일은 Xbap이 닫힐 때만이 오류가 발생하고 최근의 Windows Update 이후입니다. –

관련 문제