This project is read-only.
1
Vote

HelixViewport3D problems in COM Interop Control

description

I have been using the Helix Toolkit for about 6 months now and love it. However presently I am trying to generate a report from the HelixViewport3D.
<Grid>
   <helix:HelixViewport3D x:Name="helixViewer" IsHeadLightEnabled="True">         
      <ModelVisual3D x:Name="model">
                <ModelVisual3D.Content>
                    <Model3DGroup>
                        <Model3DGroup.Children>
                            <AmbientLight Color="#808080"/>
                        </Model3DGroup.Children>
                    </Model3DGroup>
                </ModelVisual3D.Content>
            </ModelVisual3D>
            <ModelVisual3D>
                <helix:SphereVisual3D Fill="Red"/>
            </ModelVisual3D>
        </helix:HelixViewport3D>
        <Button Content="Button" HorizontalAlignment="Left" Height="52" Margin="10,10,0,0" VerticalAlignment="Top" Width="117" Click="Button_Click"/>
    </Grid>
The button click event uses a printdialog to generate output.
  private void Button_Click(object sender, RoutedEventArgs e)
        {
            PrintDialog dlg = new PrintDialog();
            dlg.ShowDialog().GetValueOrDefault(true);

            dlg.PrintVisual(helixViewer.Viewport, "Test");
        }
If I do this in WPF or in Windows forms all is well and the code generates a report output. However if I embed the control in a COM interop UserControl then reference this within a VB6 application the same call to PrintVisual crashes with a FileNotFoundException.

This appears to be specific to the HelixViewport3D control as a regular WPF Viewport3D prints correctly also even under interop.

Can someone please advise if there is a reason this might happen. and possibly what file I may be missing that is preventing it working only under interop conditions.

Regards

xamtrix

comments