Community of VE/MapPoint Users and Developers
This is a discussion on Exposing MapPoint Enumerations within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; This question isn't specific to MapPoint, but I'm posting here because the problem arose from working with MapPoint and it ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Exposing MapPoint Enumerations I have a VB6 application that has a bunch of user controls. The business end of one of these coutrols (its an address search field) needs to be replaced (among other things, we want to leverage MapPoint's data). The user control must be coded in a .NET language (I settled on C#). Keeping with the spirit of OOP I just want to implement the existing interface and just plug in this new control. The control itself "has a" data source (MapPoint + some SQL databases). The application will be deployed in several countries. The problem I ran into is that I cannot specify wich country I want to limit my searches to without importing the MapPoint library. I want to expose the GeoCountry enumeration in the same namespace as my data source classes. To sum up the problem: Is it possible to alias a type from one namespace into another namespace and make that alias a type of its own? I've already coded a workaround. I made an uint enumeration that has all of the countries and the values are the MapPoint equvalents casted to uint. In the event that the list of coutries, their values, or their names change in future versions, I do not want to recode this list. |
| ||||
|
I think your casting kludge is the way to go. The end user/builder (I'm not sure if that is you or your customer?) is going to have to recompile if they have a new version with new enumerations, anyway. Otherwise, how will your code be aware of them? Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
|
My code is aware of them through the MapPoint object model. I'm just trying to avoid unecessary dll imports. Ideally, the control is replaced superficially (register a rcw dll and import that to instantiate the control). |
![]() |
| Tags |
| enumerations, exposing, mappoint |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Exposing MapPoint transaction counts to our Customers | routesmith | MapPoint Web Service and Virtual Earth | 0 | 01-16-2006 10:49 AM |