Community of VE/MapPoint Users and Developers
This is a discussion on Borland C++ Builder : Using Mappoint over olecontainer within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Borland C++ Builder : Using Mappoint over olecontainer or TApp TMapp Hi Team, greetz from North Italy Here a working ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Borland C++ Builder : Using Mappoint over olecontainer Hi Team, greetz from North Italy Here a working bcb sample (of course many was from your page): But I still have some Problems switching into usermode (Actually I click manually Code: int i=0;
PushpinPtr pin[5000];
LocationPtr loc[5000];
MapPtr AMap;
if (inita==0){
OleContainer1->CreateObject(WideString("MapPoint.Map.EU"),false);
inita=1;
return;
//bad that I need the above to set manually Usermode, but i was not able to figure it out
}
AMap=OleContainer1->OleObjectInterface;
loc[i]=AMap->GetLocation((double)46.48168,(double)11.11670,300);
pin[i]=AMap->AddPushpin(loc[i], WideString("TestPin")+IntToStr(i));
pin[i]->set_Symbol(2);
pin[i]->set_Highlight( true );
pin[i]->set_Note(WideString("Test Note 1") );
pin[i]->set_BalloonState( 1 );
//AMap->GoToLatLong((double)46.48168,(double)11.11670,300);
AMap->_set_Location(loc[i]);
AMap->ZoomOut();
AMap->ZoomIn();
//Now Problem Howto switch into Usermode=true
//of course i should set usermode before drawing..
_Application *Mapp; //not sure but this way should be ok !?
Mapp=AMap->get_Application(); //or get_parent()
// Mapp->UserControl //not working PUT IMPORTANT
//Mapp->Activate();
ShowMessage(AnsiString(Mapp->get_Name()));
//workz fine therefore i guess Mapp has the correct Pointer
Mapp->UserControl=0; //not working and no error !
Mapp->PaneState=7; //not working i guess
Mapp->set_Units(0); // works fine ... geoMiles = 0, geoKm = 1
AMap->set_Saved(1); //?? should it save the edit mode aka user settings ?
AMap->Save();
//Find sample 1
WideString wsStreet="Saring";
WideString wsFStreet="sda";
WideString wsFCity="bolzano";
WideString wsFOtherCity="";
WideString wsFRegion="bz";
WideString wsFPostalCode="39100";
FindResultsPtr resultsPtr = AMap->FindAddressResults(wsFStreet.c_bstr(),wsFCity.c_bstr(),wsFOtherCity.c_bstr(),wsFRegion.c_bstr(),wsFPostalCode.c_bstr());
FindResults* myResults = (FindResults*)resultsPtr;
//not working on bcb5 but ok under 6 (i guess from old utilcls)
ShowMessage(AnsiString(myResults->Count)); //returns 100 ok !!
VARIANT idx;
VariantInit(&idx);
V_VT(&idx) = VT_I4;
for (int i = 1; i<myResults->Count+1; i++)
{
V_I4(&idx)=i;
// FindResults is collection. This particular example returns multiple locations.
// Pick the first one. NB: GetItem is 1-referenced.
// the value we wish to pass
LocationPtr locHotSpringsPtr = myResults->get_Item( &idx ); //warning about idx in bcb5
Location* locHotSprings = (Location*)locHotSpringsPtr;
pin[i]=AMap->AddPushpin(locHotSprings, WideString("TestPin")+IntToStr(i));
pin[i]->set_Symbol(2);
pin[i]->set_Highlight( true );
pin[i]->set_Note(WideString("Test Note ")+IntToStr(i) );
pin[i]->set_BalloonState( 1 );
AMap->_set_Location(locHotSprings);
Sleep(500);
} //end for points
and maybe set custom shapes and how to implement a - zoom if the location was marked from the bottom to the top and + like actually implemented. And maybe i need a way to lock the drag and drop on certain custom shapes. Or a sample howto connect the TMap and TApp to the container, would be nice Thx in Advance elec29a / elec@dcmd.net Note: I tested many Mapping Software but MapPoint was amazing, if you look at the feature set & pricelevel. |
| |||
|
Hi, I edited your post to get a better view on code (please put next time into code tags). But can you please try to reprase your question to explain what exacly you wants to acomplish and what exacly not working? It is difficult for all of us to check it that way. For example many of us can try your code in their favorite languages, but it need to translate it first etc.. so probably with a bit more explanation it would be better understeandable. thx btw: do you have the mappoint logo in top right in your application ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Usermoder or Connect TMap & Tapp
Sure that we incorporate and use the trademark Logo we wanna sell a green Mappoint Europe 2004 Box to each of our clients. (I hope therefore the EULA and so on would be ok.. I see our subproduct as a Mappoint drawmytruck extension.) It would help me if someone c(w)ould support me info on howto switch the Usermode and or Howto connect manually Tapp & or Tmap to the olecontainer. Some functions did not work like expected, plz take a look at the comments in the previous sample. Thx again for the formatting.. but rather I was here asking for some comments on the questions .. Thx in advance elec29a |
![]() |
| Tags |
| borland, builder, mappoint, olecontainer |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MapPoint in OleContainer problem //BCB | tomek_tomek | MapPoint 2006/2009 Discussion | 3 | 08-16-2005 03:54 PM |
| using c++builder with mappoint | Anonymous | MapPoint 2006/2009 Discussion | 0 | 07-21-2004 04:20 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 |
| Using MapPoint with C++Builder | Anonymous | MapPoint 2006/2009 Discussion | 5 | 09-02-2003 05:37 PM |