MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Integratin MapPoint ActiveX control into VC++ 6.0

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


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-04-2006
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...
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-04-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

What is the error message ?
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 06-05-2006
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
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 06-05-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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 ?
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 06-07-2006
Junior Member
White Belt
 
Join Date: Nov 2005
Posts: 7
Send a message via ICQ to kristijan
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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 06-07-2006
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 06-07-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 06-13-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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...
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


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


All times are GMT -5. The time now is 12:33 AM.


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

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.


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