[vtkusers] Type Initialization Exception

Bertrand de Boisdeffre bertrand.boisdeffre at gmail.com
Thu Aug 26 05:47:17 EDT 2010


Hi,

I  will never understand Microsoft. I resolved my issue.

I work with Visual STUDIO 2008, use vtk 5-4-2 and Activiz.Net 5-4-2.
In fact, I build a solution including 4 projects: 3DIntegration(a wpf
window; it's the start project), UserControl3D(control wpf) and 2 others
projects.

Before, 3DIntegration and UserControl3D had got the 2 references to access
vtk Librairies (Kitware.Vtk.dll and Kitware.mummy.Runtime). All worked.

When i tried to resolve my problem, i understood that the adding of the 2
references in the start project was useless, so i removed both. And
magically, no more problem.

2010/8/26 Bertrand de Boisdeffre <bertrand.boisdeffre at gmail.com>

> Hi all,
>
> I am going to crazy. Yesterday, my windowsForm using a RenderWindowControl
> worked perfectly. This morning, when i tried to instanciate my
> renderWindowControl an initialization exception was thrown.
>
> Here was my code :
>
> System.WindowsFormHost vtkControlHost;
>
> private void vtkControlHost_Loaded(object sender, RoutedEventArgs e)
>         {
>
>             // Create the renderWindowControl
>             this.renderWindowControl = new RenderWindowControl();
>             this.renderWindowControl.Size = new
> System.Drawing.Size((int)vtkControlHost.Width, (int)vtkControlHost.Height);
>
>             // renderWindowControl Event
>             this.renderWindowControl.Load +=new
> EventHandler(this.ShowDefaultScene);
>             vtkControlHost.Child = this.renderWindowControl;
>         }
>
> public void ShowDefaultScene(object sender, EventArgs e)
>         {
>
>             this.renderWindow = renderWindowControl.RenderWindow;
>             this.renderer =
> renderWindowControl.RenderWindow.GetRenderers().GetFirstRenderer();
>
>            .....
>          }
> Before, when renderWindowControl became the vtkControlHost Child, the
> method showDefaultScene() was called. Not today, So i changed this line by
>
> this.renderWindowControl.ParentChanged +=new
> EventHandler(this.ShowDefaultScene);
>
> Then, the method was called, but in ShowDefaultScene(), i create some
> actors ( vtkPolyData, vtkPolyDataMapper, vtkActor) and when i instanciate
> the first vtk object (vtkPolyData) an initialization exception is thrown
> again.
> I don't understand, I did'nt modify anything, except others files in my
> global project. However, they don't have some Kitware dll as reference,
> so...
>
> Best regards.
>
> --
> Bertrand de Boisdeffre
> Etudiant 2A  SICOM Phelma Grenoble-INP
>
>


-- 
Bertrand de Boisdeffre
Etudiant 2A  SICOM Phelma Grenoble-INP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100826/23ef4e74/attachment.htm>


More information about the vtkusers mailing list