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

Borland C++ Builder : Using Mappoint over olecontainer

This is a discussion on Borland C++ Builder : Using Mappoint over olecontainer within the MapPoint Desktop 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 ...

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

    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 &#40;int i = 1; i<myResults->Count+1; i++&#41;
            &#123;
                    V_I4&#40;&idx&#41;=i;
                    // FindResults is collection. This particular example returns multiple locations.
                    // Pick the first one.  NB&#58; GetItem is 1-referenced.
                    // the value we wish to pass
          	 LocationPtr locHotSpringsPtr = myResults->get_Item&#40; &idx &#41;; //warning about idx in bcb5
             Location* locHotSprings = &#40;Location*&#41;locHotSpringsPtr;
    
             pin&#91;i&#93;=AMap->AddPushpin&#40;locHotSprings, WideString&#40;"TestPin"&#41;+IntToStr&#40;i&#41;&#41;;
             pin&#91;i&#93;->set_Symbol&#40;2&#41;;
             pin&#91;i&#93;->set_Highlight&#40; true &#41;;
             pin&#91;i&#93;->set_Note&#40;WideString&#40;"Test Note "&#41;+IntToStr&#40;i&#41; &#41;;
             pin&#91;i&#93;->set_BalloonState&#40; 1 &#41;;
    
            AMap->_set_Location&#40;locHotSprings&#41;;
           Sleep&#40;500&#41;;
        &#125; //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.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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 ?

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

    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

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MapPoint in OleContainer problem //BCB
    By tomek_tomek in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-16-2005, 03:54 PM
  2. using c++builder with mappoint
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 07-21-2004, 04:20 AM
  3. Borland C++ Builder and Pushpins
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-05-2004, 05:15 AM
  4. Borland C++ Builder Pushpins Problem
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-30-2004, 07:48 AM
  5. Using MapPoint with C++Builder
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 09-02-2003, 05:37 PM

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 26 27 28 29 30 31 32 33 34 35 36