Community of VE/MapPoint Users and Developers
This is a discussion on Integratin MapPoint ActiveX control into VC++ 6.0 within the MapPoint 2006/2009 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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Integratin MapPoint ActiveX control into VC++ 6.0 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... |
| |||
|
Hi, What is the error message ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
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 |
| |||
|
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 ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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);
as Code: CControl1 *m_Map; 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 ? |
| |||
|
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 |
| |||
|
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. |
| |||
|
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...
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Keyboard control in mappoint activex control | djcapslock | MapPoint 2006/2009 Discussion | 1 | 03-10-2005 10:16 AM |
| mappoint ActiveX control 9.0 | Anonymous | MapPoint 2006/2009 Discussion | 1 | 10-21-2004 06:22 AM |
| I am using Mappoint 2002 ActiveX control in a VB a.... | Anonymous | MapPoint 2006/2009 Discussion | 2 | 06-14-2002 07:10 AM |
| I am using the MapPoint ActiveX control in a VB Ap.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-24-2001 06:35 AM |
| How does one get the activeX mappoint control to d.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 07-25-2001 06:26 PM |
Cheap Ski Holidays Bulgaria
Cheap ski holidays in Bulgaria are a wonderful introduction for first time skiers. Off the slopes, Bulgaria has a fascinating cultural heritage to explore.
Turkey Weather
Check out Turkey Weather - Travel Counsellors details information on Turkey including, weather, flights and accommodation.
Holidays Thailand
Holidays in Thailand are hugely diverse with wonderful luxury resorts and beaches but also some lovely forested mountains with interesting hill tribes. See dealchecker.co.uk.
Cancun Holidays
Cancun holidays offer beautiful scenery, calm waters and plenty of shopping. Get a taste of the good life while on holiday in Cancun.
Greece
Greece covers a large area and as a result there is an abundance of things to do, see and taste. You can relax on a beach, visit ancient sites or make a trip to one of the islands like Corfu, Crete or Rhodes.
Inclusive Holidays
At Travel.co.uk travel comparison will help you plan the perfect inclusive holidays.
Sharm el Sheikh Holidays
Visit Egypt! Get info on Sharm El Sheikh holidays, only at On The Beach.