调试 COMException
我正在使用古老的 Intergraph 路由库来做一些路由。
我可以很好地创建多个 ActiveX 和 COM 对象,但有一种类型“Location”和“LocationCtrl”会在创建时引发 COMException。
以下是相关代码
_sourceLocation.Streets = _streets;
_sourceLocation.VerifyAutomatic = fa_sourceLocationse;
_sourceLocation.VerifyType = VerifyTypeConstants.VerifyUsingA_sourceLocation_sourceLocation;
_sourceLocation.ReplaceTextAfterParse = true;
_sourceLocation.ReplaceTextAfterVerify = true;
_sourceLocation.Map = _mapOcx;
设置 Streets 属性时抛出 COMException。
这里有一个例外:
System.Runtime.InteropServices.COMException was unhandled
Message="Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"
Source="mscorlib"
ErrorCode=-2147418113
StackTrace:
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Intergraph.LocationCtrlClass.set_Streets(Object )
at ECNavigator.Routing.<InitializeRouting>b__0(LocationCtrl l) in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Routing.cs:line 92
at ECNavigator.Util.FrameworkExtensions.ForEach[T](IEnumerable`1 enum, Action`1 action) in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Util\FrameworkExtensions.cs:line 18
at ECNavigator.Routing.InitializeRouting() in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Routing.cs:line 90
at ECNavigator.Routing..ctor(String mapFile, LocationCtrl sourceLocation, LocationCtrl destinationLocation) in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Routing.cs:line 62
at ECNavigator.Program.Main() in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Program.cs:line 23
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()
InnerException:
整个应用程序非常简单,它只包含初始化一些支持对象的代码,但是这个特定的 Location
类型可以很好地初始化,但是在第一次调用属性 getters/setters 时,它会抛出上面的异常。
我已经对此进行了几天的调试,但还没有找到正确实例化和初始化 Location
类的方法。
有什么线索吗? 关于如何进一步调查此事的一些指示?
I am using an ancient Intergraph routing library to do some routing.
I could create several ActiveX and COM objects just fine but there is this one type "Location" and "LocationCtrl" that throws a COMException on creation.
Here's the relevant code
_sourceLocation.Streets = _streets;
_sourceLocation.VerifyAutomatic = fa_sourceLocationse;
_sourceLocation.VerifyType = VerifyTypeConstants.VerifyUsingA_sourceLocation_sourceLocation;
_sourceLocation.ReplaceTextAfterParse = true;
_sourceLocation.ReplaceTextAfterVerify = true;
_sourceLocation.Map = _mapOcx;
The COMException was thrown upon setting the Streets property.
Here's the exception:
System.Runtime.InteropServices.COMException was unhandled
Message="Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"
Source="mscorlib"
ErrorCode=-2147418113
StackTrace:
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Intergraph.LocationCtrlClass.set_Streets(Object )
at ECNavigator.Routing.<InitializeRouting>b__0(LocationCtrl l) in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Routing.cs:line 92
at ECNavigator.Util.FrameworkExtensions.ForEach[T](IEnumerable`1 enum, Action`1 action) in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Util\FrameworkExtensions.cs:line 18
at ECNavigator.Routing.InitializeRouting() in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Routing.cs:line 90
at ECNavigator.Routing..ctor(String mapFile, LocationCtrl sourceLocation, LocationCtrl destinationLocation) in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Routing.cs:line 62
at ECNavigator.Program.Main() in C:\Users\Chakrit\Projects\NavigatorService\Experimental\Program.cs:line 23
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()
InnerException:
The entire application is extremely simple, it contained only code that initialize some of the supporting objects, however this particular Location
type would initialize just fine but on first invocation of property getters/setters, it would throw the above exception.
I have been debugging this for a few days already and havn't found a way to instantiate and initialize the Location
class properly.
Any clue? Some pointers on how to further investigate this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论