Microsoft Developer Network > Forums Home > Microsoft Research Forums > Microsoft Automatic Graph Layout > Null Reference Exception and Invalid Operation Exceptions

Answered Null Reference Exception and Invalid Operation Exceptions

  • Wednesday, March 10, 2010 1:19 AM
     
     
    I'm getting some strange exceptions while creating and then later updating a dynamically generated graph.
    I can catch and ignore them, but after a second or two I see the graph flicker and sometimes disappear when I do so.

    Looking for any help with these, thanks!

    The first seems similary to the other post about Null Reference exception

       at Microsoft.Msagl.GeometryGraph.PumpTheBoxToTheGraph(Rectangle& b) in C:\dev\MSAGL_RTMJune2008\LayoutEngine\GraphLayoutApi\GeometryGraph.cs:line 600
       at Microsoft.Msagl.GeometryGraph.PumpTheBoxToTheGraphWithMargins() in C:\dev\MSAGL_RTMJune2008\LayoutEngine\GraphLayoutApi\GeometryGraph.cs:line 585
       at Microsoft.Msagl.Engine.RunPostLayering() in C:\dev\MSAGL_RTMJune2008\LayoutEngine\Engine\Engine.cs:line 241
       at Microsoft.Msagl.Engine.Run() in C:\dev\MSAGL_RTMJune2008\LayoutEngine\Engine\Engine.cs:line 226
       at Microsoft.Msagl.SugiyamaLayoutSettings.CalculateLayout(GeometryGraph msaglGraph) in C:\dev\MSAGL_RTMJune2008\LayoutEngine\GraphLayoutApi\SugiyamaLayoutSettings.cs:line 187
       at Microsoft.Msagl.GeometryGraph.CalculateLayout() in C:\dev\MSAGL_RTMJune2008\LayoutEngine\GraphLayoutApi\GeometryGraph.cs:line 416
       at Microsoft.Msagl.GraphViewerGdi.GViewer.LayoutAndCreateDGraph() in C:\dev\MSAGL_RTMJune2008\GraphViewerGDI\GViewer.cs:line 962
       at Microsoft.Msagl.GraphViewerGdi.GViewer.CalculateLayout(Graph graph) in C:\dev\MSAGL_RTMJune2008\GraphViewerGDI\GViewer.cs:line 1498
       at Microsoft.Msagl.GraphViewerGdi.GraphRenderer.CalculateLayout() in C:\dev\MSAGL_RTMJune2008\GraphViewerGDI\GraphRenderer.cs:line 28
       at Microsoft.Msagl.GraphViewerGdi.GraphRenderer.Render(Graphics graphics, Rectangle rect) in C:\dev\MSAGL_RTMJune2008\GraphViewerGDI\GraphRenderer.cs:line 59
       at BroadbandConfig.Controls.WirelessGraphControl.paintGraph(Graph g, Rectangle gClip, Graphics graphics) in C:\Documents and Settings\Trevor Ackerman\My Documents\Visual Studio 2005\Projects\BroadbandConfig-msagl-trial\BroadbandConfig.Controls\WirelessGraphControl.cs:line 720
       at BroadbandConfig.Controls.WirelessGraphControl.OnPaint(PaintEventArgs e) in C:\Documents and Settings\Trevor Ackerman\My Documents\Visual Studio 2005\Projects\BroadbandConfig-msagl-trial\BroadbandConfig.Controls\WirelessGraphControl.cs:line 732
       at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
       at System.Windows.Forms.Control.WmPaint(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.DebuggableCallback(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.Application.Run(Form mainForm)
       at BroadbandConfig.Program.Main() in C:\Documents and Settings\Trevor Ackerman\My Documents\Visual Studio 2005\Projects\BroadbandConfig-msagl-trial\BroadbandConfig\Program.cs:line 17
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    And the other is InvalidOperationException

    "a node with id 63:F8:E7 does note the boundary curve set"

       at Microsoft.Msagl.SugiyamaLayoutSettings.CalculateLayout(GeometryGraph msaglGraph) in C:\dev\MSAGL_RTMJune2008\LayoutEngine\GraphLayoutApi\SugiyamaLayoutSettings.cs:line 157
       at Microsoft.Msagl.GeometryGraph.CalculateLayout() in C:\dev\MSAGL_RTMJune2008\LayoutEngine\GraphLayoutApi\GeometryGraph.cs:line 416
       at BroadbandConfig.Controls.WirelessGraphControl.periodicWorker_DoWork(Object sender, DoWorkEventArgs e) in C:\Documents and Settings\Trevor Ackerman\My Documents\Visual Studio 2005\Projects\BroadbandConfig-msagl-trial\BroadbandConfig.Controls\WirelessGraphControl.cs:line 332
       at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

Answers

  • Friday, June 04, 2010 12:43 PM
     
     Answered
    I'm getting some strange exceptions while creating and then later updating a dynamically generated graph.
    I can catch and ignore them, but after a second or two I see the graph flicker and sometimes disappear when I do so.


    I wonder if these exceptions from different threads? Can you provide more information?

All Replies

  • Thursday, March 11, 2010 7:23 PM
    Owner
     
     
    it looks like you are changing the graph while the layout is being calculated on this graph.
    Thanks,
    Lev
    Lev Nachmanson
  • Friday, June 04, 2010 12:43 PM
     
     Answered
    I'm getting some strange exceptions while creating and then later updating a dynamically generated graph.
    I can catch and ignore them, but after a second or two I see the graph flicker and sometimes disappear when I do so.


    I wonder if these exceptions from different threads? Can you provide more information?
  • Thursday, May 26, 2011 3:36 PM
    Owner
     
     

    Sorry for the huge delay. Yes, the layout is calculated in a separate thread.

    Thanks,

    Lev


    Lev Nachmanson