ThinkGeo.com    |     Documentation    |     Premium Support

Weird problem with COM Interop

Scott,


I've tried the latest version you suggested but unfortunately I get the same result. I've attached 2 screenshots, one with the exception message and the other with the location of the exception. I don't know if these are helpful.




I've tried also to call my COM Object using late binding but got the same result so I guess that rules out any issues with the type library. Is it possible for someone over there to try to create a test application in another Win32 language (not .NET), like C++ or VB and try use my COM object and see if anything happens?


Happy New Year :)


Regards,

Kostas


 


 



Exception.jpg (13.9 KB)
001_CPU.jpg (92.9 KB)

Kostas, 
  
 I would like to ask you did you try to use the early binding, from your screen shots I cannot found out any useful information, currently I just guessed where is the reason in the Geocoder core, did you install the .NET Framework 3.5 more higher version on your local machine, if not, please install the .NET Framework 3.5 or higher version to try again, because we used many technologies of .NET Framework 3.5. 
  
 Thanks, 
  
 Scott,

Scott, 
  
 I get the same screenshot no matter if it’s early or late binding. I had already installed all the .NET Frameworks from 1.0 to 4.0 so there is no issue with that. 
  
 Thanks, 
 Kostas 


Kostas, 
  
 Thanks for your responses, I checked all the posts above, there is one thing need to confirm with you, was this problem only exist in the reverse geocoding? The geocoding is successful in your application, is that true? If that, I’m  afraid of the crash problem is from the RTree component, in our reverse geocoding we use the RTree component to locate the zip code area so that we can find out the enter coordinate in a small range such as a zipcode area. I checked all the source code for the reverse geocoding, there are not any doubtful codes can cause the crash problem, in the previous version we have changed the Linq implemention and use general code to implement it. So I believe this is the only reason can cause your crash problem in your application.  
  
 We will have a discussion about it to see are there any work around for your application. 
  
 Thanks, 
  
 Scott,

Scott, 
  
 This problem exists *only* in reverse geocoding (e.g. entering coordinates as a search string in the UsaGeocoder.Match mehod). Normal geocoding works fine. 
  
 FYI, if I use my COM object via a VBScript in my Delphi application (by using the MS Script Control object) then it works fine. That’s the only workaround I have found so far. 
  
 Thanks, 
 Kostas 


Kostas,


I have a suggestion to you and need your helps to validte the crash problem is either in the RTree functionality or the other places, because we don't have the Delphi environment so please create another new sample application and reference the MapSuiteCore.dll, then copy the following code to your new sample application:


 


 



RtreeSpatialIndex rtreeIndex = new RtreeSpatialIndex(Path.Combine(dataFilePath, "rt2.idx"));
rtreeIndex.Open();
Dictionary<string, RECTANGLE_D> streetsInsideZip = rtreeIndex.GetRecordByBoundingBoxIndexesContainingRectangle(upperLeftX, lowerRightY,lowerRightX, upperLeftY);
rtreeIndex.Close();
You can specify the upperLeftX, LowerRightY, LowerRightX, upperLeftY values by yourself, we just need to validate the rtree functionality. This is a simple sample and we use this function in MapSuiteGeocoder core code for reverse geocoding, also when you use this sample code above please through the COM methods to reference the MapSuiteCore.dll so that we can find out the crash reason.


Thanks,


Scott,



Scott, 
  
 Referencing the MapSuiteCore.dll will give me an error when I try to build my assembly (for COM interop) because the MapSuiteCore.dll is not signed with a strong key. You provide a version with a strong key sign for the MapSuiteGeocoder but not for the MapSuiteCore. Unless I am missing something. 
  
 Regards, 
 Kostas 


Kostas,


We have two versions for each product, one is Geocoder general version, another is Geocoder string named version, here is the screen shot in the zip file of MapSuiteGeocoder dll package below:



Please reference the MapSuiteGeocoder.dll in the Geocoder folder and make a simple sample according to my code to check the Rtree component in your Delphi application.

 


If you have any questions please let me know,


Thanks,


Scott,


 



Scott, 
  
 I cannot use the RtreeSpatialIndex class unless I reference the MapSuiteCore.dll as well. Doing so will lead to the problem I mentioned in my last message. The exact message I get from the compiler is “Assembly generation failed – Referenced assembly ‘MapSuiteCore’ does not have a strong name” 
  
 Regards, 
 Kostas 
  
  
  
  

Kostas,


I'm sorry I made a mistake for you, I meant that you need to reference the MapSuiteCore.dll without strong named, in the ServicesEdition dll package there are also two folders below:



Open the Services Edition(Not Services Edition- Strong Named) folder then you can see the MapSuiteCore.dll that without strong named,  please reference this dll directly so the strong name issue in your application can be resolved correctly,


Thanks,


Scott,



Scott, 
  
 I can’t find those folders (Services Edition) in my “Map Suite Geocoder Full Edition 4.5” (evaluation) folder list. Any suggestion? 
  
 Thanks, 
 Kostas 


Kostas, 
  
 There is one thing need to confirm with you first, did you purchase the ServicesEdition? The MapSuiteCore.dll is belong to the ServicesEdition, therefore, you still can get it from this location: C:\Program Files\ThinkGeo\Map Suite Geocoder Full Edition 4.5\HowDoISamples\Dependencies\Desktop. 
  
 In this folder it includes all dlls for MapSuite DesktopEdition, you can just reference the MapSuiteCore.dll to try again, 
  
 Thanks, 
  
 Scott,

Scott,


My company has not bought the ServicesEdition. In fact we haven't bought anything yet as we are still evaluating the product. I have already tried to use the MapSuiteCore.dll under C:\Program Files\ThinkGeo\Map Suite Geocoder Full Edition 4.5\HowDoISamples\Dependencies\Desktop but this version is not signed with a strong key so I cannot use it. That's what I had said in previous messages.


Posted By Kostas on 01-12-2011 03:16 AM 



Referencing the MapSuiteCore.dll will give me an error when I try to build my assembly (for COM interop) because the MapSuiteCore.dll is not signed with a strong key. You provide a version with a strong key sign for the MapSuiteGeocoder but not for the MapSuiteCore. Unless I am missing something. 


Posted By Kostas on 01-12-2011 08:15 AM


I cannot use the RtreeSpatialIndex class unless I reference the MapSuiteCore.dll as well. Doing so will lead to the problem I mentioned in my last message. The exact message I get from the compiler is "Assembly generation failed -- Referenced assembly 'MapSuiteCore' does not have a strong name" 


Since I am building an assembly for COM interop all assembiles referenced have to be strong signed, otherwise I cannot compile my project.


Thanks,

Kostas


 



Kostas, 
  
 So can you install the ServicesEdition Evaluation on your machine? Because we don’t have the Delphi envrionment so we just can track the crash problem in your side, we guessed there are two things maybe caused the crash problem, one is linq implemention, another is the Rtree queries, now we have removed the linq implemention from the core code, so we have to determine the problem is whether from the Rtree queries, in order to validate it you have to reference the MapSuiteCore.dll so please download and install the ServicesEdition and create a simple sample using the code what I posted,  
  
 If you have any issues about it please let us know, 
  
 Thanks, 
  
 Scott,

Scott, 
  
 I could try downloading and installing it but can I do it along with the existing Map Suite Geocoder that I already have installed? Or would that cause problems? 
  
 Thanks, 
 Kostas 


Kostas, 
  
 Yes, you can do it along with the exsting MapSuite Geocoder that you already have installed, I just guessed the crash problem is from the Rtree queries, because in the reverse geocoding, we used the Rtree queries to restrcit the zipcode area, so that’s the reason why I sent the rtree queries code to you and hope you can make a simple sample by delphi to check the problem, 
  
 Now after you installed the ServicesEdition, you just need to reference it and use the rtree code to test by delphi, for this case, we just validate the Rtree queries to see if it is whether caused the crash problem, 
  
 Thanks, 
  
 Scott,

Scott,


I've installed the Services Edition as you suggested. I have referenced MapSuiteCore under C:\Program Files\ThinkGeo\Map Suite Services Evaluation Edition 4.5\Developer Reference\Service Edition - Strong Named. I get the following complilation errors: 


Error 1 The type or namespace name 'RECTANGLE_D' could not be found (are you missing a using directive or an assembly reference?)


Error 2 'ThinkGeo.MapSuite.Core.RtreeSpatialIndex' does not contain a definition for 'GetRecordByBoundingBoxIndexesContainingRectangle' and no extension method 'GetRecordByBoundingBoxIndexesContainingRectangle' accepting a first argument of type 'ThinkGeo.MapSuite.Core.RtreeSpatialIndex' could be found (are you missing a using directive or an assembly reference?)


I already have the  using ThinkGeo.MapSuite.Core;


Any suggestion to why I cannot compile the code you gave me?



Regards,

Kostas

 


 


 



Kostas, 



Right now let us make the issue more clear, please check the comments what you mentioned below: 



01-11-2011 10:48 AM Quote Reply Alert 

Scott, 



This problem exists *only* in reverse geocoding (e.g. entering coordinates as a search string in the UsaGeocoder.Match mehod). Normal geocoding works fine. 



FYI, if I use my COM object via a VBScript in my Delphi application (by using the MS Script Control object) then it works fine. That's the only workaround I have found so far. 



Thanks, 

Kostas 





You said you have found out the workaround through the VBScript in your Delphi application, so I think that is the right way for you, I guessed maybe the problem is from the Rtreet queries, if that's true, we have no ideas on that because of the Rtree queries are the core arithmetic for reverse geocoding. Also I attached the sample for testing the rtreet queries to you, because the limition of the attachment I just attached the sample application, not include the dlls, so please reference the MapSuiteCore.dll by yourself, the version what I tested is 4.5.0.0. 



If you have still have any questions please let us know, 



Thanks, 



Scott,



Post8554.zip (9.92 KB)

Scott, 
  
 I tried your sample code you provided in the attached zip file and it worked fine inside my COM Object so I guess that rules out the problem in the Rtreet query. 
  
 Regards, 
 Kostas 


Kostas, 
  
 I would like to confirm with you about your workaround method for this issue, you ever said  if you used your COM object via a VBScript in your Delphi application (by using the MS Script Control object) then it works fine. That’s the only workaround I have found so far. So if it is true can you use the workaround method in your application, as so far, we really cannot re-produce your problem correctly and we don’t have the Delphi environment to test it, the core code of reverse-geocoding seems to be fine. If it is possible, I suggest you to use the workaround method in your application if there are any other problems in the future please let us know, 
  
 Thanks, 
  
 Scott,