views:

524

answers:

1

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?

Thanks!

A: 

Hi Chakrit, if you comment out the Streets line does the next line throw an exception? i.e. does setting any property throw it, or is it specific to the Streets property?

gkrogers
It is not specific to the Streets property, I have not tried all combinations of invocation but most result in the same COMException.
chakrit