[vtkusers] render control hosting in wpf

mirko heuegger mheuegger at gmail.com
Thu Jun 13 03:55:53 EDT 2013


Hello!

Using WinForms and WPF is a little bit tricky, especially with third party
components.

For me (win7, and Visual Studio 2012), this settings works:

I'm loading the RenderWindowControl only at run-time, eg:

aWindowsFormsHostControl.Child = new RenderWindowControl()

and adding this code to the Constructor of you WPF-Window:

#if (DEBUG)
    if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) {
        return;
    }
#endif


hth

mirko



On Thu, Jun 13, 2013 at 8:52 AM, Max <smapersmaper at gmail.com> wrote:

> Hi VTKers,
> I am getting an exception:
> ************* Exception Text **************
> System.Exception: error: could not get registered type - mteIndex='1'
> classNameKey=''
>    at Kitware.mummy.Runtime.Methods.GetConstructorInfo(UInt32 mteIndex)
>    at Kitware.mummy.Runtime.Methods.CreateWrappedObjectImpl(UInt32
> mteStatus, UInt32 mteIndex, UInt32 rawRefCount, IntPtr rawCppThis, Boolean
> callDisposalMethod, Boolean& created)
>    at Kitware.mummy.Runtime.Methods.CreateWrappedObject(UInt32 mteStatus,
> UInt32 mteIndex, UInt32 rawRefCount, IntPtr rawCppThis, Boolean
> callDisposalMethod, Boolean& found)
>    at Kitware.VTK.vtkRenderer.New()
>    at Kitware.VTK.RenderWindowControl.OnHandleCreated(EventArgs e)
>    at System.Windows.Forms.Control.WmCreate(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.UserControl.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)
>
> When trying to open the xaml.
> I'm hosting the render control of activiz (which is winforms) in wpf.
> It runs ok but when i'm tryign to open the xaml it gives this exception.
> Someone maybe can help?
>
> Thank you,
> Max
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/render-control-hosting-in-wpf-tp5721366.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
Real programmers don't document; if it was
hard to write, it should be hard to understand.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130613/6cd0de7b/attachment.htm>


More information about the vtkusers mailing list