ThinkGeo.com    |     Documentation    |     Premium Support

COM Wrapper & ActiveX Interface

Hi,


We have an application that we would like to integrate Map Suite Into but is built in Borland C++ Builder 2009.   We have integrated in other ActiveX components into our Builder Environment so we have some experience in this area and know how to do the integration this way.


Does Map Suite have any COM Wrapper or ActiveX interfaces we can interface to to use the .NET component.  I see in Visual Studio there are compile options that allow a class library to be Register for COM interop.  I was curios if Map Suite Desktop and Service edition are compiled in this way.


Thanks!



Clint,


 


Map <st1:address w:st="on"><st1:street w:st="on">Suite</st1:street> 3</st1:address> now doesn’t have and COM Wrapper.  We will do some investigation and if it is very easy to add, we will do it on the upcoming release around 22rd this month. I guess it will be easy but we need to test and make sure it will not bring other problems.


 


Thanks for bring it up to us.


 


Ben


 



Thanks Ben!  I’m anxious to try it out this week when the new release is available.

Clint,


After some investigation, I am afraid Map Suite can hardly provide a Com Wrapper, at least in a short time.
 
Dot Net provides some ways to expose a .NET assembly to COM, but I think that works for a project that once ready and for all, not for a product which needs long term maintaining. One big reason is that to wrapper a .NET assembly to COM, abstract type cannot be used and classes should implement interfaces explicitly (though we can let .NET generate class interface for us automatically, see here, but that will bring more versioning issue in the future ). However in Map Suite 3.0, we avoid using any interfaces as it is not flexible at all, once created, it cannot be modified without breaking change, which will be very tough to maintain and add new features. I think this is the main reason we cannot do the COM wrapper on Map Suite products.
 
For more requirements about wrapper a .NET dll to COM, please have a look at the link below.
msdn.microsoft.com/en-us/library/7fcfby2t(VS.71).aspx
 
The”register for COM interop” option in Visual Studio simply wrapper the current dll to COM and register it in the current machine, to make a COM wrapper for a .NET assembly, we need to add interfaces to the corresponding classes and add attribute to every type, to specify the Guid, the interface type and other attributes. As mentioned before, we can only add attributes to classes and let .NET generate class interface automatically, but the cost of maintenance will be pretty high.
 
I hope I made it clear, there are still many stuff to investigate on this field and please let me know if you have anything.
 
Thanks,
 
Ben