Community of VE/MapPoint Users and Developers
This is a discussion on Map Point ActiveX in MFC View (MDI application) within the MapPoint 2006/2009 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) { ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Map Point ActiveX in MFC View (MDI application) 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. |
| |||
| 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(); |
| |||
| "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(); |
![]() |
| Tags |
| activex, application, map, mdi, mfc, point, view |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| View by zip code | John Swanick | MapPoint 2006/2009 Discussion | 8 | 07-12-2005 09:05 AM |
| Choosing what to view | Anonymous | MapPoint 2006/2009 Discussion | 1 | 12-04-2003 04:46 AM |
| Will Map Point work for this application? | Jim Mateski | MapPoint 2006/2009 Discussion | 4 | 11-12-2003 11:29 AM |
| 3D View | Anonymous | Wish List | 0 | 06-06-2003 06:19 PM |
| Print View | healthsouthgirl | MapPoint 2006/2009 Discussion | 1 | 08-14-2002 10:03 PM |