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

Mappoint in OleContainer problem //Delphi

This is a discussion on Mappoint in OleContainer problem //Delphi within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, I just started to play with mappoint 2002 trial & Delphi 7... So with the helph of this site ...

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

    Mappoint in OleContainer problem //Delphi

    Hi,

    I just started to play with mappoint 2002 trial & Delphi 7...
    So with the helph of this site I already get a map in my delphi form and I can zoom and pan....

    Here's my code: (OleContainer, map dropped on a form)

    procedure TForm1.FormShow(Sender: TObject);
    var
    vGuid : TGuid;
    FMap : _Map;
    begin
    OleContainer_Map.CreateObject('MapPoint.Map.EU.9', FALSE );
    OleContainer_Map.DoVerb(1);
    OleContainer_Map.OleObjectInterface.GetUserClassID (vGuid);
    FMap := IDispatch(OleContainer_Map.OleObject) as _Map;
    Map1.ConnectTo(FMap);
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    Map1.ZoomIn;
    end;

    procedure TForm1.Button2Click(Sender: TObject);
    begin
    Map1.pan(geoEast,0.5);
    end;

    But when I close the Form I get allways the following message:
    Application Error:
    Exception EAccesVilation in module OLE32.dll at...

    Any idea?? (I'm not familiar with the OleContainer...)

  2. #2
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    I'm not a Delphi developer, but there are some samples in the Articles section of this site that might be of use to you.. Also, there's some discussions in the forums. You might employ Google to list it all in one swoop: http://www.google.com/search?q=site:...g%2Ecom+Delphi

    Happy Mapping!
    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

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

    Hope some Delphi coder could helph me...

    hanks for your quick reply! :D

  4. #4
    Jack is offline Junior Member White Belt
    Join Date
    Jan 2003
    Posts
    8
    Try the following in FormClose:

    OLECont.Align := alNone;
    and free all your Delphi controls (Form, Menu, Toolbar, ...)

    Greetings, Jack.

  5. #5
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Ok I finally solved this problem by myself :D

    Just added this:
    procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
    begin
    Map1.Disconnect;
    end;

    And no more Application Error 8)

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

    I am a Delphi Developer and use the code similar to you. The difference is that I don't do a connect. Still seems to work well here.

    Code:
      OleContainer1.CreateObject('MapPoint.Map.NA.9',False);
      OleContainer1.DoVerb(1);
      OleContainer1.OleObjectInterface.GetUserClassID(vGuid);
      mpMap := IDispatch(OleContainer1.OleObject) as _Map;
    Ray[/code]

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

    I am doing the same thing, but I need to disable the toolbar and the directions pane. I just want to display the map only.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MapPoint in OleContainer problem //BCB
    By tomek_tomek in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-16-2005, 03:54 PM
  2. Borland C++ Builder : Using Mappoint over olecontainer
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 02-14-2005, 05:04 AM
  3. OleVariant Problem with Delphi 6
    By top204 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 04-29-2004, 05:51 AM
  4. Delphi OleContainer Resize Problem.
    By Sheridan in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 12-19-2003, 06:50 AM
  5. Delphi OleContainer problems
    By pafreshney in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 09-15-2003, 02:50 PM

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