MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Using MapPoint with C++Builder

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


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-08-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Using MapPoint with C++Builder

Hello,

somebody used MapPoint with C++Builder 6?
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 07-08-2003
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,472
Blog Entries: 1
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.
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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 07-08-2003
Harv's Avatar
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
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 08-18-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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?
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 08-18-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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...
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 09-02-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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);

}
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

Tags
builder, mappoint


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
Borland C++ Builder : Using Mappoint over olecontainer Anonymous MapPoint 2006/2009 Discussion 2 02-14-2005 05:04 AM
using c++builder with mappoint Anonymous MapPoint 2006/2009 Discussion 0 07-21-2004 04:20 AM
C++ Builder and Pushpins Anonymous MapPoint 2006/2009 Discussion 6 05-25-2004 04:56 AM
Borland C++ Builder and Pushpins Anonymous MapPoint 2006/2009 Discussion 0 04-05-2004 05:15 AM
Borland C++ Builder Pushpins Problem Anonymous MapPoint 2006/2009 Discussion 0 03-30-2004 07:48 AM


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


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