MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Borland C++ Builder : Using Mappoint over olecontainer

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


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 02-10-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Borland C++ Builder : Using Mappoint over olecontainer

Borland C++ Builder : Using Mappoint over olecontainer or TApp TMapp

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
I would appreciate it If someone could help me with Usermode
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.
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 02-10-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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 ?
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 02-14-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
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
borland, builder, mappoint, olecontainer


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


All times are GMT -5. The time now is 08:56 AM.


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