[lnkForumImage]
TotalShareware - Download Free Software

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


 

Elvian

8/1/2007 10:25:00 AM

Hello,

I'm having an issue with a dotNet component I wrote. The component is
basically a Winform usercontrol, hosting in a tableLayoutPanel a WPF
component (external librairy .dll).

I'm registering this Winform component to COM interop to include it as
an ActiveX control into an existing Visual Studio 6 MFC application.

Moreover, I would like my ActiveX control (understand the whole .NET
thing, especially the WPF part) to resize to the size of the MFC
hosting window.

Everything is working well if I set up 3 anchors points for my
tableLayoutPanel (left, right, top for eample. In this case, the
control resize only its width), but as soon as I want to set-up 4
anchors points, or to put the dock property to "fill", when I run the
MFC application (hosting the .NET stuff), I get an error :

"Microsoft .NET Framework
Unhandled exception has occured in a component in your application. If
you clicl Continue, the application will ignore this error and attempt
to continue" (which fails, actually... "unhandled exception, access
violation" in the visual studio 6 debugger)

"Exception from HRESULT: 0x88980406"

There is a detail button, and I get this when I expand it :

///////////////////////////////////////////////////////////////////////////
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x88980406): Exception
from HRESULT: 0x88980406
at MS.Internal.HRESULT.Check(Int32 hr)
at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()
at System.Windows.Media.MediaContext.NotifySyncModeStatus(Int32
enabledResult)
at System.Windows.Media.MediaContext.NotifyChannelMessage()
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.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 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&
msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32
reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at
System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception
t)
at System.Windows.Forms.Control.WndProcException(Exception e)
at
System.Windows.Forms.Control.ControlNativeWindow.OnThreadException(Exception
e)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.SafeNativeMethods.SetWindowPos(HandleRef
hWnd, HandleRef hWndInsertAfter, Int32 x, Int32 y, Int32 cx, Int32 cy,
Int32 flags)
at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y,
Int32 width, Int32 height, BoundsSpecified specified)
at
System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle
bounds, BoundsSpecified specified)
at
System.Windows.Forms.Layout.TableLayout.SetElementBounds(ContainerInfo
containerInfo, RectangleF displayRectF)
at
System.Windows.Forms.Layout.TableLayout.LayoutCore(IArrangedElement
container, LayoutEventArgs args)
at System.Windows.Forms.Layout.LayoutEngine.Layout(Object
container, LayoutEventArgs layoutEventArgs)
at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs
levent)
at System.Windows.Forms.TableLayoutPanel.OnLayout(LayoutEventArgs
levent)
at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
at
System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement
affectedElement, String affectedProperty)
at
System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement
elementToLayout, IArrangedElement elementCausingLayout, String
property)
at System.Windows.Forms.Control.OnResize(EventArgs e)
at System.Windows.Forms.Panel.OnResize(EventArgs eventargs)
at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y,
Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
at System.Windows.Forms.Control.UpdateBounds()
at System.Windows.Forms.Control.WmWindowPosChanged(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1318 (redbitsb1.050727-1300)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WinFormToActiveX3v9
Assembly Version: 1.0.2769.16256
Win32 Version: 1.0.2769.16256
CodeBase: file:///C:/work/test/WinFormToActiveX/WinFormToActiveXv9/WinFormToActiveX3/bin/Debug/WinFormToActiveX3v9.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1318 (redbitsb1.050727-1300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1318 (redbitsb1.050727-1300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1318 (redbitsb1.050727-1300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1318 (redbitsb1.050727-1300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
WindowsFormsIntegration
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.0 (vista_rtm_wcp.061020-1904)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/WindowsFormsIntegration/3.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
----------------------------------------
PresentationFramework
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.0 (vista_rtm_wcp.061020-1904)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework/3.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
PresentationCore
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.0 (vista_rtm_wcp.061020-1904)
CodeBase: file:///C:/WINDOWS/assembly/GAC_32/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
WindowsBase
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.0 (vista_rtm_wcp.061020-1904)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1318 (redbitsb1.050727-1300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.1318 (redbitsb1.050727-1300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
WPFFinalPanel
Assembly Version: 0.0.0.0
Win32 Version: 0.0.0.0
CodeBase: file:///C:/work/test/WinFormToActiveX/WinFormToActiveXv9/WinFormToActiveX3/bin/Debug/WPFFinalPanel.DLL
----------------------------------------
PresentationFramework.Luna
Assembly Version: 3.0.0.0
Win32 Version: 3.0.6920.0 (vista_rtm_wcp.061020-1904)
CodeBase:
file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework.Luna/3.0.0.0__31bf3856ad364e35/PresentationFramework.Luna.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
///////////////////////////////////////////////////////////////////////////


I don't know why there is an exception thrown when I put 4 anchors and
not when I only put 3 of them.

If there is something fondamentaly wrong with my way of doing things,
please let me know, and give me advice for a better way.

Thanks in advance

CD