MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Map Point ActiveX in MFC View (MDI application)

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


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 03-30-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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.
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 06-09-2004
Junior Member
White Belt
 
Join Date: Jun 2004
Posts: 5
I'm having trouble with this as well.

Any solutions to this?

Thanks
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 07-02-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 08-06-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
"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();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 11-14-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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.
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
activex, application, map, mdi, mfc, point, view


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


All times are GMT -5. The time now is 04:05 PM.


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