svipxu / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

RunTimeBinderException when running KML files #86

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Using VS2010 Windows 7 C#
2. Click on a KML file
3.

What is the expected output? What do you see instead?
I expect to see a map.  Sometimes I do, up to twice in a row.  Sometimes I get 
an exception right away.  Following is an excerpt from my own records of this 
problem.

PROBLEM: Running RanchoHiguera.kml file.  Get RunTimeBinderException occurred 
in Anonymously Hosted DynamicMethods Assembly.  Also “System._ComObject does 
not contain a definition for getOuterBoundary”.  Same Exception on 
Sundance.kml file.

In Fraser Chapman’s GEHelpers.cs code you see an interesting note:

case ApiType.KmlPolygon:
                    {
                        // TODO - make this work better...
                        dynamic p = feature.getOuterBoundary().getCoordinates().get(0);
                        return LookAt(ge, p.getLatitude(), p.getLongitude(), p.getAltitude());
                    }

What version of the product are you using? On what operating system?
Feb 2012. Windows 7. VS2010.

Please provide any additional information below.
Adding a mapping capability to surveillance cameras built by RVision in San 
Jose, Ca.

Original issue reported on code.google.com by rcsu...@gmail.com on 18 Jul 2012 at 4:44

GoogleCodeExporter commented 8 years ago
Same issue is being faced by me while using the Multiple geometry thing. I get 
the exception at System.__ComObject' does not contain a definition for 
'getOuterBoundary'.

case ApiType.KmlMultiGeometry:
                    {
                        if (walkGeometries)
                        {
                            WalkKmlDom(feature.getOuterBoundary(), callback, walkFeatures, walkGeometries);
                        }
                    }

Stack Trace says:  

   at CallSite.Target(Closure , CallSite , ComObject )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at CallSite.Target(Closure , CallSite , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at FC.GEPluginCtrls.KmlHelpers.WalkKmlDom(Object feature, Action`1 callback, Boolean walkFeatures, Boolean walkGeometries) in D:\Documents and Settings\nitingo\Desktop\drive_testing\winforms-geplugin-control-library\trunk\Helpers\KmlHelpers.cs:line 928
   at CallSite.Target(Closure , CallSite , Type , Object , Action`1 , Boolean , Boolean )
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid5[T0,T1,T2,T3,T4](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
   at FC.GEPluginCtrls.KmlHelpers.WalkKmlDom(Object feature, Action`1 callback, Boolean walkFeatures, Boolean walkGeometries) in D:\Documents and Settings\nitingo\Desktop\drive_testing\winforms-geplugin-control-library\trunk\Helpers\KmlHelpers.cs:line 906
   at CallSite.Target(Closure , CallSite , Type , Object , Action`1 , Boolean , Boolean )
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid5[T0,T1,T2,T3,T4](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
   at FC.GEPluginCtrls.KmlHelpers.ComputeBounds(Object kmlFeature) in D:\Documents and Settings\nitingo\Desktop\drive_testing\winforms-geplugin-control-library\trunk\Helpers\KmlHelpers.cs:line 50
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at FC.GEPluginCtrls.GEHelpers.FlyToObject(Object ge, Object feature, Boolean boundsFallback, Double aspectRatio, Double defaultRange, Double scaleRange) in D:\Documents and Settings\nitingo\Desktop\drive_testing\winforms-geplugin-control-library\trunk\Helpers\GEHelpers.cs:line 150
   at CallSite.Target(Closure , CallSite , Type , Object , Object )
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at FC.GEPluginCtrls.KmlTreeView.OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e) in D:\Documents and Settings\nitingo\Desktop\drive_testing\winforms-geplugin-control-library\trunk\Controls\KmlTreeView.cs:line 356
   at System.Windows.Forms.TreeView.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(IntPtr 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 SimpleGUI.Program.Main() in D:\vital_2_2_vs2010\Vital_239_g726_new_vs2010\SimpleGUI\Program.cs:line 75
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly 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, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Original comment by nitinkum...@gmail.com on 23 Jul 2012 at 7:04

GoogleCodeExporter commented 8 years ago
Thanks for theses...I will take a look asap

Original comment by fraser.c...@gmail.com on 31 Jul 2012 at 8:59

GoogleCodeExporter commented 8 years ago
This is now fixed, the issue was the incorrect call to `getOuterBoundary` - 
obviously this was wrong and the call is now  `getGeometries` i.e.

 ...

 case ApiType.KmlMultiGeometry:
      objectContainer = walkGeometries ? feature.getGeometries() : null;
      break;

 ...

Thanks again for the input! 

Fraser

Original comment by fraser.c...@gmail.com on 2 Dec 2012 at 9:48

GoogleCodeExporter commented 8 years ago
Just to note, the KmlPolygon issue also fixed...

  case ApiType.KmlPolygon:
       if (walkGeometries)
       {
         WalkKmlDom(feature.getOuterBoundary(), callback, walkFeatures, true);
       }
       break;

Original comment by fraser.c...@gmail.com on 2 Dec 2012 at 9:50