Community of VE/MapPoint Users and Developers
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?...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
|
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;
appears in the Container. Code: void __fastcall TfrmMain::FormActivate(TObject *Sender)
{
GUID vGuid;
OleContainer->CreateObject("MapPoint.Map.NA.11", false);
OleContainer->DoVerb(1);
}
(Delphi Code: FMap := IDispatch(OleContainer.OleObject) as _Map; Can somebody help me? |
| |||
| 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... |
| |||
| 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); } |
![]() |
| Tags |
| builder, mappoint |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |