spacer1
spacer2 1_1 1_2
2_1
 Subscribe
 The MP2K Update!
 
 
 
 Magazine
Front Cover
What's New
Articles
News
Sample Data
Gallery
Advertise
About
 Features
MapPoint 2009
Press Releases
MapPoint Forums
Companies
Link to MP2Kmag
Wish List
MapPoint Trial
Authors
 Earlier Content
Past News Items
Past What's New Announcements
 Sponsors
 Order

MapPoint 2009

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
ViaVirtualEarth
SVG Tutorials
MapPoint

Map Visitors

 Direct Media

Travel Insurance Compare over 450 travel insurance policies (inc. annual multi-trip, single trip & winter sports)

  ARTICLES  


Automating MapPoint with the .NET SDK

As Gilles Kohl showed in a previous article, it's possible to program MapPoint with only the free .NET Framework SDK. This article illustrates a simple program using this technique for generating images from MapPoint.

Much like ASP.NET, desktop application developers have a choice of using one of the tools in Visual Studio .NET (C#, VB.NET, etc.) or simple a text editor for developing programs using the .NET framework. Visual Studio supports drag and drop/automatic code generation, debugging support, Intellisense, and a host of other valuable programing features. Writing programs with a text editor and compiling at the command-line provides little of that and can be analogized as freely available 'water' to Visual Studio's 'Coke' (or Jamba Juice for the health-concious :-)..

In this article we will compile a simple program written with the humble TextPad text editor which generates images of the U.S. states. First, let's take a look at the code:

This is placed in a text file with a .vb extension and along with a few supporting files is all that is need to compile at the command line. First, review the prerequisites as outlined by Gilles in the previous article. To compile this program you will need the .NET platform SDK.

Then, download the code and supporting files and extract to a working directory. Note that although I don't use it here, I've included the MPToolbox library for good measure. To successfully compile and run the program, you will also need to generate the MapPoint.dll to enable .NET to communicate with MapPoint. This is done at the command prompt by typing
TLBIMP "C:\Program Files\MapPoint 2002 North America\MPNA81.TLB"
(substitute the path to your MapPoint installation/the .tlb file as necessary).

Now, to compile the program, type
VBC @GenStates.rsp
at the command prompt. If you've kept your fingers crossed this whole time, you should be rewarded with a nifty little executable for generating images of the 50 U.S. States (plus Washington D.C.). A gallery of the images is posted here.

Discuss this story in the forum.

Author: Eric Frost
Email: website(AT)mp2kmag.com
URL: http://www.mp2kmag.com
Eric is Editor and Publisher of MP2K Magazine and is a part-time student in University of Chicago's evening MBA program. Eric recently finished the MP2Kmag Guide What's New in MapPoint 2004.



Google
 
MP2Kmag Internet


 Recent Discussion
-BingMapsDev: From today you can now gaze up and explore the stars from Bing Maps Silverlight thx to WWT http://is.gd/aMtvs
-BingMapsDev: @jont87 I was thinking that as I virtually looked up at the stars from the Vegas strip, with all this neon I'm not sure what you'd see.
-bingmaps: BingMapApps pull local blogs, tweets, embedded videos, historic photos, worldwide telescope imagery and more into maps! http://bit.ly/bCPnlb
-bingmaps: @AllTheWiser Nice!You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: @Buitel Nice!You won the BingMaps contest!DM your address and we'll mail your t-shirt.Few hours left for everyone else http://bit.ly/adOWAO
-bingmaps: @cdlongo Nice!You won the BingMaps contest!DM your address and we'll mail your t-shirt.A few hours left for other folks http://bit.ly/adOWAO
-bingmaps: @ddavidch Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: @Gilly2468 Nice!You won the BingMaps contest!DM your address and we'll mail your shirt. Few hours left for other folks http://bit.ly/adOWAO
-bingmaps: @markmcc19 Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: @mp2kmag Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: @NicolasBoonaert Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. A few more hours left for everyone else
-bingmaps: @virus84 Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. A few more hours left for other folks
-bingmaps: @WebJives2 Nice! You won the BingMaps contest! DM your address and we'll mail your t-shirt. http://bit.ly/adOWAO
-bingmaps: RT @ChrisPendleton: Watching "Opening up opportunity with Twitter" @rsarver @raffi #Mix10
-bingmaps: RT @ChrisPendleton: Windows Phone 7 Series Developer Training Kit: http://bit.ly/aHiBPW. Now, we just need to add some Bing Maps!
-bingmaps: RT @ChrisPendleton: New Bing Maps Application - WorldWide Telescope: http://bit.ly/bEwrEE.
-Importing Data into Mappoint
-deleting the number associated with pushpins.
-New Bing Maps Application: WorldWide Telescope
-bingmaps: Don't miss out! One more day to tweet to win a Bing t-shirt. Details here: http://bit.ly/adOWAO
-bingmaps: RT @ChrisPendleton: SxSW Musings and Where the World Is: http://bit.ly/9OBAU6. @BingMaps #SxSWi
-Problems with FindResults
-Restrict routes based on country of origin/destination
-How to Retrive location name form latitude and Longitude in J2ME?
-SxSW Musings and Where the World Is
 Resources
Browse GIS books and periodicals
Best Car Contract Hire Lease Save
Find a MapPoint Partner or Consultant
Real Estate Columbia, MO


Want Your Site To Appear Here?

   © 1999-2009 MP2K. Questions and comments to: website@mp2kmag.com
  Microsoft and MapPoint 2002/2004/2006/2009 are either trademarks or registered trademarks of Microsoft.

• Replacement Cordless Phone Batteries from DSMiller
Improve your career with a computer degree LocalEDU.com
• Tim Cohn's Marketing Strategy Consultancy
• Buy Toner Cartridges at Marquee Office Solutions
• Looking for Dry Erase Boards? See Dry Erase Boards • The Search Starts Here Used Cars
• 5339 - We Know Bikes: Road Bikes / Triathlon Bikes / Mountain Bikes / BMX Bikes
• Buy Your Car Used Cars UK, Car Lease and Contract Hire