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

Integratin MapPoint ActiveX control into VC++ 6.0

This is a discussion on Integratin MapPoint ActiveX control into VC++ 6.0 within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, could someone help me: I am a beginner in using MapPoint ActiveX control. I've integrated MapPoint control into my ...

  1. #1
    geouser is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    13

    Integratin MapPoint ActiveX control into VC++ 6.0

    Hi, could someone help me:
    I am a beginner in using MapPoint ActiveX control. I've integrated MapPoint control into my MFC project and a lot of MapPoint specific wrapper classes are added to my project. First step will be to make a US map appear on the screen after the user clicks my application's menu. I've tried this (following a suggestion given on MP2K forum - thank you for this one):

    The user clicks the menu and the following routine will be processed:

    void CMapPointTestView::OnMappoint()
    {
    CMappointCtrl MapPoint;
    VARIANT var;
    var.vt = VT_INT;
    var.intVal = 1; //geoMapUSA
    CMap1 map = MapPoint.NewMap(var);

    }

    It has to be somthing using an instance of CMappointCtrl calling NewMap(). But no map appears. Instead, I get an error message!
    Can someone help me?
    Thanks in advance...

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

  3. #3
    geouser is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    13
    Hi Wilfried:

    It is a dialog box from the VC++ Debug Library saying: Debug Assertion failed [as I run the debug mode]
    File: winocc.cpp
    Line: 345 [which is the ASSERT-call in CWnd::InvokeHelper(..) ]

    If i click 'Ignore' another dialog box appears saying something like: Test.exe has a problem and has to be stopped.



    Jörg

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    But you are using the activeX component. I do not understeand the code. What is wrong calling the name of the component with the newMap method ? Or is there something I do no see ?

  5. #5
    kristijan is offline Junior Member White Belt
    Join Date
    Nov 2005
    Posts
    7

    vc++ and mappoint

    hiho
    i have also an active x object in a vc++ programm and a wrapper class around it. THis is my code where i create the object and do show the map.
    Code:
     
            m_Map = new CControl1;
            m_Map->Create(NULL, WS_VISIBLE, r, CWnd::FromHandle(dlg_App.m_hWnd), 2001);
            VARIANT newMap;
            VariantInit(&newMap);
            V_VT(&newMap) = VT_I4;
            V_I4(&newMap) = m_Map->geoMapEurope;		
            m_Map->NewMap(newMap);
    where the variable m_Map is a in my class defined
    as
    Code:
        CControl1       *m_Map;
    and the CControl1 is the wrapper class around the idl stuff, library.

    i also encountered the problem that it is necessary that the interaction with the controll has to be in the main message handler.
    i did define the m_map variable also in the class of my application, because you have to be very carefull with every object you create from the control. (it has to be released when you are done with operating).

    Besides this i have 2 questsions->
    First Problem is : how can i deactivate the right mous button menu ? I don't want to show a menu at all.

    Second problem : Where is my callback function where i can track mappoint actions ?

  6. #6
    geouser is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    13
    Hi Wilfried, Kristijan :

    The problem with my code above was (at least)

    CMappointCtrl MapPoint;

    I forgot to connect the CMapPointCtrl instance to the MapPoint ActiveX control element implemented into the view-object. So what I have now is

    VARIANT var;
    var.vt = VT_INT;
    var.intVal = 1; //geoMapUSA
    CMap1 map = m_MapPoint.NewMap(var);

    where m_MapPoint is a member variable of CMapPointTestView which has to be connected to the MapPoint control element (using the wizzard).

    The map appears now but the program collapses once I click in it or change the window size.

    So Kristijan: Thanks for your suggestion. I will try your code.

    Jörg

  7. #7
    geouser is offline Junior Member Yellow Belt
    Join Date
    Jun 2006
    Posts
    13
    Second problem : Where is my callback function where i can track mappoint actions ?

    Im not sure whether I understand your queston:
    You will have to catch theWnd messages coming from your ActiveX control element. The possibilities are displayed if you open MFC class wizzard and click the object-ID to which you have connected your ActiveX control (for example: IDC_CONTROL1). In the 'messages' display you will find the messages coming back from your control.

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    I think that you mean the events from the component ? There are a lot of events where you can assign event handlers to. Like MouseMove, SelectionChange, etc...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Re: Keyboard control in mappoint activex control
    By djcapslock in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-10-2005, 11:16 AM
  2. mappoint ActiveX control 9.0
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-21-2004, 07:22 AM
  3. I am using Mappoint 2002 ActiveX control in a VB a....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-14-2002, 08:10 AM
  4. I am using the MapPoint ActiveX control in a VB Ap....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-24-2001, 07:35 AM
  5. How does one get the activeX mappoint control to d....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-25-2001, 07:26 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96