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

Using MapPoint with C++Builder

This is a discussion on Using MapPoint with C++Builder within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, somebody used MapPoint with C++Builder 6?...

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

    Using MapPoint with C++Builder

    Hello,

    somebody used MapPoint with C++Builder 6?

  2. #2
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    I have not, but you might want to see the examples with Delphi and C++ on the site, search "site:mp2kmag.com Delphi" on Google.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  3. #3
    Harv's Avatar
    Harv is offline Junior Member White Belt
    Join Date
    May 2003
    Posts
    3
    If you figure out how to get MapPoint object library to work in C++ Builder, please let me know. I have gotten it to work using code similar to the Delphi code posted on this site, however, I have not been able to get all the functionality to work.

    The MapPoint OCX will not work in Builder or Delphi, you have to use automaion using COM. Regrettably, I have had to use Visual Basic for now to make use of all the published MapPoint API.

    Harv

  4. #4
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    I try to use Mappoint in my C++Builder-Application too.
    Having read the Delphi-Example I have used an OleContainer.

    In the Delphi-Tutorial the author uses this code to create
    the OLE-Object.
    Code:
    procedure TForm1.FormActivate(Sender: TObject);
    var  vGuid : TGuid;
    begin   OleContainer.CreateObject('MapPoint.Map.EU.9', False);
      OleContainer.DoVerb(1);   OleContainer.OleObjectInterface.GetUserClassID(vGuid);
      FMap := IDispatch(OleContainer.OleObject) as _Map;
    end;
    I have translated it to C++ and the North-America-Map
    appears in the Container.

    Code:
    void __fastcall TfrmMain::FormActivate(TObject *Sender)
    {
        GUID vGuid;
        OleContainer->CreateObject("MapPoint.Map.NA.11", false);
        OleContainer->DoVerb(1);
    }
    The problem is, that i cannot get last line to work:
    (Delphi
    Code:
      FMap := IDispatch(OleContainer.OleObject) as _Map;
    in order to get control over the Map.

    Can somebody help me?

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

    C++ Builder with Mappoint

    I am only looking to put a pushpin on the map and change its position. I have created the Mappoint map in an OleContainer but can't find a way to get the control interface to do anything with the map. I am use the mouse on it, but that is all. I need to zoom and change the centre x & y position etc.

    How do I get a pointer to the Map for use with the Map functions.

    If I declare a Map object in C++ Builder such as this:

    Map *pMap;

    How do I actually use the OleContainer to point this pointer to a valid Mappoint map. I can see the functions, but the pointer is invalid when the programme runs. Hope this makes sense???

    Dave...

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

    Cbuilder and mappoint

    To use mappoint on your form in Cbuilder use the following (simple!) code. Remember to call 'ole->DestroyObject' before the form closes, otherwise an error comes up.

    Don't forget to include
    #pragma link "MapPoint_OCX"
    in the top of the form, after #pragma package(smart_init)

    succes, Jan Vieveen.


    MapPtr map;
    //---------------------------------------------------------------------------
    void __fastcall TForm1::FormActivate(TObject *Sender)
    {

    ole->CreateObject("MapPoint.Map.EU.9", false);
    ole->DoVerb(1);

    map = ole->OleObjectInterface;
    map->GoToLatLong(43, -3, 100);

    }

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Borland C++ Builder : Using Mappoint over olecontainer
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 02-14-2005, 05:04 AM
  2. using c++builder with mappoint
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 07-21-2004, 04:20 AM
  3. C++ Builder and Pushpins
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 05-25-2004, 04:56 AM
  4. Borland C++ Builder and Pushpins
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-05-2004, 05:15 AM
  5. Borland C++ Builder Pushpins Problem
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-30-2004, 07:48 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