0 Replies Latest reply on Oct 15, 2014 9:04 PM by Robert Simpson

    SetPageSetupOptions crashes EModelViewControl in x64 on .NET 4.5

    Robert Simpson

      Using Windows 8.1, running the sample code provided by SolidWorks at this location:

      2012 SolidWorks API Help - Getting Started - eDrawings.Interop.EModelViewControl


      I added one more line of code to the program, this:


      void eDrawingsControl_OnFinishedLoadingDocument(string FileName)



        MessageBox.Show("Opened: " + FileName);


      eDrawingControl1.eDrawingControlWrapper.SetPageSetupOptions(EModelView.EMVPrintOrientation.eLandscape, 1, 0, 0, 1, 7, "", 0, 0, 0, 0);



      When compiled with .NET 4.0 or earlier, the program runs fine, loads a drawing and sets the page options.  When compiled on .NET 4.5 or 4.5.1 the program crashes with:


      First-chance exception at 0x00000001800bb58b (EModelView.dll) in eDrawingsExample.exe: 0xC0000005: Access violation reading location 0x000000003026d308.


      Unhandled exception at 0x00000001800bb58b (EModelView.dll) in eDrawingsExample.exe: 0xC000041D: An unhandled exception was encountered during a user callback.


      The thread 'Win64 Thread' (0x1504) has exited with code 0 (0x0).


      Only crashes on x64 with eDrawings 2014.