Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

Exposing MapPoint Enumerations

This is a discussion on Exposing MapPoint Enumerations within the MapPoint Desktop 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 ...

  1. #1
    revelashon is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    14

    Exposing MapPoint Enumerations

    This question isn't specific to MapPoint, but I'm posting here because the problem arose from working with MapPoint and it is a possibility that some of you may have encountered this before.

    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.

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    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

  3. #3
    revelashon is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    14
    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).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Exposing MapPoint transaction counts to our Customers
    By routesmith in forum Bing Maps and MapPoint Web Service
    Replies: 0
    Last Post: 01-16-2006, 10:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36