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 9 of 9

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

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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 &#40;oleCount1 < 1&#41; then
      begin
        ShowMessage&#40;'No results &#40;1&#41;'&#41;;
        Exit;
      end;
    
      oleResult1 &#58;= 1;
      ID1 &#58;= mpResults1.Item&#91;oleResult1&#93;;
      Loc1 &#58;= Location&#40;ID1&#41;;
    
      mpResults2 &#58;= Map.FindResults&#40;'SN8 2QE'&#41;;
      oleCount2 &#58;= mpResults2.Count;
      if &#40;oleCount2 < 1&#41; then
      begin
        ShowMessage&#40;'No results &#40;2&#41;'&#41;;
        Exit;
      end;
    
      oleResult2 &#58;= 1;
      ID2 &#58;= mpResults2.Item&#91;oleResult2&#93;;
      Loc2 &#58;= Location&#40;ID2&#41;;
    
    
      Dist &#58;= Loc1.DistanceTo&#40;Loc2&#41;;
    
      //ShowMessage&#40;FloatToStr&#40;Dist&#41;&#41;;
    
      FMapPoint.Release;
      FMapPoint &#58;= nil;

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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

  4. #4
    Garo is offline 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?

  5. #5
    Garo is offline 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 &#58;= TRUE;
    mpMap&#58;= mpApplication.ActiveMap;
    mpMap.GoToLatLong&#40;43, -3, 100&#41;;
    into

    Code:
    mpMap&#58;= mpApplication.ActiveMap;
    mpMap.Application.Visible &#58;= TRUE;
    mpMap.GoToLatLong&#40;43, -3, 100&#41;;
    and now MapPoint is visible whenever I run the application.

  6. #6
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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

  7. #7
    Garo is offline 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

  8. #8
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    In order to get application to show

    You must run the latest version of the runtime librabry.

  9. #9
    henk is offline 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?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MapPoint 2004 and Delphi 5
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 01-20-2005, 07:34 AM
  2. Mappoint addin with Delphi 6
    By jeanluc in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 09-15-2003, 03:03 PM
  3. How to get mappoint Active X in Delphi?
    By jmiller55 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-31-2003, 10:54 PM
  4. MapPoint.Application in Delphi
    By joesebi in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-11-2003, 06:16 AM
  5. Mappoint With Delphi 5
    By stuarth in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-08-2003, 11:21 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96