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

Map Point ActiveX in MFC View (MDI application)

This is a discussion on Map Point ActiveX in MFC View (MDI application) within the MapPoint Desktop Discussion forums, part of the Map Forums category; Did somebody knows how to embed a MapPointCtrl into FormView in MFC. I tried to use BOOL CRaw_com1Dlg::PreTranslateMessage(MSG* pMsg) { ...

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

    Map Point ActiveX in MFC View (MDI application)

    Did somebody knows how to embed a MapPointCtrl into FormView in MFC.
    I tried to use
    BOOL CRaw_com1Dlg::PreTranslateMessage(MSG* pMsg)
    {
    // for modeless processing (or modal)
    ASSERT(m_hWnd != NULL);
    ASSERT(::IsWindow(m_hWnd));

    if (((CLEDOccManager*)afxOccManager)->IsDialogMessageHACK(this, pMsg))
    return TRUE;

    // filter both messages to dialog and from children
    return PreTranslateInput(pMsg);
    }
    from dialog based application, but when I click on the Map the application got a Stack overflow.

  2. #2
    StreetPusher is offline Junior Member White Belt
    Join Date
    Jun 2004
    Posts
    5
    I'm having trouble with this as well.

    Any solutions to this?

    Thanks

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

    The Fix

    OK, this is what worked for me.

    In your CMapPointCtrl class add this public function:

    inline COleControlSite* GetCtrlSite() {return m_pCtrlSite;}

    Remember that when you re-init your activeX control this file will get written over.


    And then when you initiliaze the map do this:

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

    // This fixes the problem
    m_pCtrlCont->OnUIDeactivate(m_MapPoint.GetCtrlSite());
    m_pCtrlCont->OnUIActivate(NULL);
    SetFocus();

    ReleaseCapture();

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

    "The Fix" to "Map Point ActiveX in MFC View (

    Hi everyone,

    I tried the below solution (please scroll down) by adding the code into my form view CTryMP1View::OnInitialUpdate(), and I got this compiler error complaining about "m_pCtrlCont":

    error C2027: use of undefined type 'COleControlContainer'
    c:\vs\vc98\mfc\include\afxwin.h(1872) : see declaration of 'COleControlContainer'

    Could anyone tell me how the poster got the "m_pCtrlCont" pointer???
    Could you please reply to kchan@KenwoodUSA.com ?

    Thanks in advance!

    ===== ORIGINAL MESSAGE posted by "ImplicitSoftware" =======

    OK, this is what worked for me.

    In your CMapPointCtrl class add this public function:

    inline COleControlSite* GetCtrlSite() {return m_pCtrlSite;}

    Remember that when you re-init your activeX control this file will get written over.


    And then when you initiliaze the map do this:

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

    // This fixes the problem
    m_pCtrlCont->OnUIDeactivate(m_MapPoint.GetCtrlSite());
    m_pCtrlCont->OnUIActivate(NULL);
    SetFocus();

    ReleaseCapture();

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

    ImplicitSoftware - I am grateful to you for your help!

    That is so wonderful! I had no optmizm for a decision of that problem. I was so busy by another topics on my project.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. View by zip code
    By John Swanick in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 07-12-2005, 09:05 AM
  2. Choosing what to view
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 12-04-2003, 04:46 AM
  3. Will Map Point work for this application?
    By Jim Mateski in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 11-12-2003, 11:29 AM
  4. 3D View
    By Anonymous in forum Wish List
    Replies: 0
    Last Post: 06-06-2003, 06:19 PM
  5. Print View
    By healthsouthgirl in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-14-2002, 10:03 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