MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Exposing MapPoint Enumerations

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-16-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 06-16-2006
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 899
Blog Entries: 10
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 06-17-2006
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).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
enumerations, exposing, mappoint


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 10:30 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55