MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Using MapPoint In Delphi

This is a discussion on Using MapPoint In Delphi within the MP2K Magazine Articles forums, part of the Map Forums category; Jack Melgers explains how developers can go about using MapPoint within Delphi and provides several code snippets Read the full ...


Go Back   MapPoint Forums > Map Forums > MP2K Magazine Articles

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-21-2002
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Using MapPoint In Delphi

Jack Melgers explains how developers can go about using MapPoint within Delphi and provides several code snippets

Read the full article: http://www.mp2kmag.com/articles.asp?ArticleID=65
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 10-14-2002
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Problems with Delphi

Please can someone tell me why I get "...EAccessViolation with message 'Access violation at address 00000000. Read of address 00000000'..." whenever I run this code? (It always happens on the distanceto line.

Code:
  Application.CreateForm(TFMapPoint, FMapPoint);

  FMapPoint.OC1.CreateObject('MapPoint.Map.EU.9', False);
  FMapPoint.OC1.DoVerb(1);
  FMapPoint.OC1.OleObjectInterface.GetUserClassID(vGuid);
  Map := IDispatch(FMapPoint.OC1.OleObject) as _Map;

  mpResults1 := Map.FindResults('WR9 8UH');
  oleCount1 := mpResults1.Count;
  if (oleCount1 < 1) then
  begin
    ShowMessage('No results (1)');
    Exit;
  end;

  oleResult1 := 1;
  ID1 := mpResults1.Item[oleResult1];
  Loc1 := Location(ID1);

  mpResults2 := Map.FindResults('SN8 2QE');
  oleCount2 := mpResults2.Count;
  if (oleCount2 < 1) then
  begin
    ShowMessage('No results (2)');
    Exit;
  end;

  oleResult2 := 1;
  ID2 := mpResults2.Item[oleResult2];
  Loc2 := Location(ID2);


  Dist := Loc1.DistanceTo(Loc2);

  //ShowMessage(FloatToStr(Dist));

  FMapPoint.Release;
  FMapPoint := nil;
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 10-28-2002
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I'm having a problem with the code in the article

Hi

I cannot get either code example to work with Delphi 6.

The first method runs MapPoint but the window is invisible.

The second method takes 30 seconds to respond to the Zoom() call and uses 150Mb of memory whilst doing so.

Can anyone suggest why these methods don't work for me?

Thanks

Jim

Jim Burns
Delivearn Limited
Scotland
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-11-2003
Junior Member
White Belt
 
Join Date: Apr 2003
Posts: 3
Re: I'm having a problem with the code in the article

Quote:
Originally Posted by jimburns
Hi

I cannot get either code example to work with Delphi 6.

The first method runs MapPoint but the window is invisible.

The second method takes 30 seconds to respond to the Zoom() call and uses 150Mb of memory whilst doing so.

Can anyone suggest why these methods don't work for me?

Thanks

Jim

Jim Burns
Delivearn Limited
Scotland
I'm having the same problem. MapPoint is invisible when I initialize it and add some pushpins. But when I close the application mapPoint becomes visible and asks whether I want to save the changes or not.
Any hints how tro solve the problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-11-2003
Junior Member
White Belt
 
Join Date: Apr 2003
Posts: 3
I solved the problem with invisible form. It seems when you assign mp Application.ActiveMap to mpMap it doesn't keep Application's Visible property's value. I replaced the code in the article

Code:
mpApplication.Visible := TRUE;
mpMap:= mpApplication.ActiveMap;
mpMap.GoToLatLong(43, -3, 100);
into

Code:
mpMap:= mpApplication.ActiveMap;
mpMap.Application.Visible := TRUE;
mpMap.GoToLatLong(43, -3, 100);
and now MapPoint is visible whenever I run the application.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 05-10-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
problem with delphi 6

hi,
just got MapPoint 2002 and am trying to use the ActiveX control in Delphi,
but everytime I try to place it on my form I get the error "No such
interface supported". Then, there are only 2 component in "Active X" and Map Point Application isn't there.
best regards
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 05-10-2003
Junior Member
White Belt
 
Join Date: Apr 2003
Posts: 3
You need to import MapPoint ActiveX control before using it.
Check this article for instructions how to do that - http://mp2kmag.com/articles.asp?Arti...dress.verifier
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 07-04-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
In order to get application to show

You must run the latest version of the runtime librabry.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 12-05-2005
Junior Member
White Belt
 
Join Date: Dec 2005
Posts: 1
mappoint installed on server

Thanks for this fabulous info on connecting MapPoint to Delphi!

Is it possible to connect the OleClassName/OleContainer to MapPoint installed on a serverlocation instead of local machine?

Adding a path to mpOleContainer.CreateObject('MapPoint.Map.EU.11',F ALSE) will probably not do the job? Can I manipulate my registery somehow? Does anybody know how to do this?
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


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
MapPoint 2004 and Delphi 5 Anonymous MapPoint 2006/2009 Discussion 6 01-20-2005 06:34 AM
Mappoint addin with Delphi 6 jeanluc MapPoint 2006/2009 Discussion 2 09-15-2003 02:03 PM
How to get mappoint Active X in Delphi? jmiller55 MapPoint 2006/2009 Discussion 1 07-31-2003 09:54 PM
MapPoint.Application in Delphi joesebi MapPoint 2006/2009 Discussion 1 07-11-2003 05:16 AM
Mappoint With Delphi 5 stuarth MapPoint 2006/2009 Discussion 1 04-08-2003 10:21 AM


All times are GMT -5. The time now is 05:58 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

Holidays Benidorm
Make your holidays in Benidorm to enjoy over 1000 bars, clubs and restaurants! The beaches are superb with great facilities and watersports. Book online...

Spain Holidays
Find great Spain Holidays with Travel Counsellors. A personal Travel Counsellor can help you plan the perfect holiday to Spain.

Thailand Holidays
Thailand Holidays can suit your budget when you book with dealchecker.co.uk. If you are strapped for cash, visit online to find the deal for you.

Holidays in Cyprus
Holidays in Cyprus are enriched by the abundance of churches, ruins and natural wonders. Book a holiday with us today!

Spain
Spain is such a diverse country that it has something to offer most holidaymakers. Finding delicious cuisine is no challenge and the shopping ranges from designer boutiques to unknown flea markets. Spain has much to offer.

Holiday Comparison
We can help you with holiday comparison when you check out the options at Travel.co.uk

Cheap Lanzarote Holidays
The Canary Islands beckons you to come! View information on cheap Lanzarote holidays at On The Beach!


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