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

Programming MapPoint in .NET

MapPoint Book

  Spatial Community
SVG Tutorials
MapPoint

Map Visitors

  ARTICLES  


MapPoint and Visual Studio 2010 Tutorial

Wilfried Mestdagh shows how to get started with Visual Studio 2010 and MapPoint 2010 development in this first of a two-part article.

Getting Started with MapPoint in Visual Studio 2010

Part 1: Using the object model

Wilfried Mestdagh's article shows how to use MapPoint in Visual Studio 2010.

Sometimes people think MapPoint's architecture is getting dated and has difficulties working with modern development tools. Well, nothing is less true. Every modern development tool is perfectly suited to do development with MapPoint. This article is a small tutorial on how to start with MapPoint in VS2010, using the object model.

This article assumes you have installed Visual Studio 2010 and MapPoint 2010 (or any other version).

We start the development tool and create a new windows forms application. First thing to do is to add the MapPoint type library to our project. To do this click right on 'References' in the Solution Explorer and then click 'Add' as shown below:

Next click the tab 'COM Components', then 'Microsoft MapPoint Control 17 type library' as shown below, then click 'OK'.

Now we add a few 'using' clause as shown below and then we can start:

Now we start coding a little. What it does is the following:

  • Try to attach to a running instance of MapPoint. If no instance is running then we create a new one.
  • Attach a Quit event handler. If someone closes MapPoint then we don't want to survive either.
  • If we close then we close MapPoint also, but only if we have created the instance ourself.

Special notes:

  • You see there a mysterious typecast. This is because there is a method 'Quit' and an event with the same name. Visual Studio takes the method as default, hence the typecast.
  • Visual Studio as well as MapPoint have both an Application object. So we use full path of it to get the right one.

Now you are ready to code and let MapPoint do exacly what you want for your application. Happy coding :)

Discuss this story in the forum.

Author: Wilfried Mestdagh
Email: wilfried(AT)mestdagh.biz
Wilfried Mestdagh works as software engineer at the company Sonal in Mortsel, Belgium. His main work is writing software for fleet management and onboard computers. Fleet management is mainly written in Delphi and C# while the onboard computers are mostly programmed in C. His department started years ago for specializing in tracking and tracing security and dangerous transport vehicles, but it is grown to satisfy a very wide of vehicle / truck fleet customers.



Google
 
MP2Kmag Internet


 Recent Discussion
-numeca fine
-AutoColor
-SolidThinking Inspire v2016.1.5559 x64-BEAN (17/8)
-Auto FX PhotoGraphic Edges Ultimate Bundle Gen2 v9.6.0 (17/8)
-Mentor Graphics FloEFD 14.2-SSQ (17/8)
-Dlubal RFEM 5.06 (x64) Multilanguage (17/8)
-Bluebeam Revu eXtreme 2018.1 v18.x Multilingual (17/8)
-Autodesk Maya 2018.4 (17/8)
-Adobe Bridge CC 2018 (v8.1) x86-x64 Multilingual Update 2 (17/8)
-Simufact.Welding 4.0.1 (17/8)
-ANSYS Discovery Enterprise 19.1.1 (17/8)
-Aurora SPARK3D v2018
-ANSYS Electromagnetics Suite 17.1 (17/8)
-Solidthinking Inspire v2018.3.0.10526 Multilingual (x64) (17/8)
-Adobe Acrobat Pro DC 2018.011.20058 Multilingual (17/8)
-ANSYS Electromagnetics Suite 17.0 (x64) (17/8)
-GibbsCAM 12.0.29.0 (x64) Multilingual (17/8)
-Autodesk Autocad Mechanical 2019.1 by m0nkrus (17/8)
-Adobe Bridge CC 2018 v8.1 (x86/x64) Update 2 Multilingual (17/8)
-Autodesk AutoCAD Electrical 2019.1 (17/8)
-DS V5R22 CATIA-DELMIA-ENOVIA last hotfixes for all SP (17/8)
-VMware Fusion Pro 10.1.3 Build 9472307 (17/8)
-MAGIX Fotostory easy 2.0.0.35 Germany + English (17/8)
-Ds Simulia Abaqus v6.14-4 (17/8)
-Paragon Drive Copy 15 Professional 10.1.25.779 (x86/x64) (17/8)
 Resources
Browse GIS books and periodicals
Find a MapPoint Partner or Consultant
Real Estate Columbia For Sale By Owner


Want Your Site To Appear Here?

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