MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Access some hidden features in MapPoint2002 ActiveX control

This is a discussion on Access some hidden features in MapPoint2002 ActiveX control within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, An example project under the link below shows a technique (using WinAPI) to access MapPoint2002 functionality (like 'Location Sensor' ...


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 01-16-2003
Junior Member
Yellow Belt
 
Join Date: Jan 2003
Posts: 23
Access some hidden features in MapPoint2002 ActiveX control

Hi,

An example project under the link below shows a technique (using
WinAPI) to access MapPoint2002 functionality (like 'Location Sensor' or
'Measure Distance' from 'Tools' menu), which is not readily available in
the ActiveX control.

Download:
http://www3.sympatico.ca/spavlov/mappoint_extended.zip

The code is not well documented and does not pretend to be bug-free.
But, it is not too complex to understand.

Ones who are interested in the technique employed to extend the MapPoint ActiveX
functionality, read the article here: http://www.mp2kmag.com/articles.asp?ArticleID=88

I appreciate responses, fixes as well as reports about new functionality
been accessed and not present in the posted example.

Thank you,

Sergiy Pavlov
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 02-20-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
Hi ,

just downloaded the extented .zip.
Wonderful things happening here.

You did that great!

As I am new to VB and MapPoint I have some problems
integrating your code into mine:

First: With the MapPoint.cls I have name-conflict. I changed that module to mapoin and pasted the code into.

First I want to include that location sensor.
With

objMap.DragBehavior = MapPointSupport.geoDragLocationSensor

you call that function. And here's where I get an error saying no such objet existing (got a german version). Do have an idea what's the problem?


Thanks a lot

Peter
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 02-24-2003
Junior Member
Yellow Belt
 
Join Date: Jan 2003
Posts: 23
Peter:

check if you created an instance of objMap BEFORE accessing its property.
You shoould have "Set objMap = New MapPoint" (or whatever the name of the class) somewhere in the code.

Sergiy
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 02-25-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
Hi Sergiy,

I still do have the name-conflict. I changed the classmodule mappoint to mappoin, did the

Set objMap = New MapPoin

had a problem with the moPan, commented it and... the location sensor is working now!

Thanks a lot!

Peter
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 02-27-2003
Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 45
Hi,

I tried to port your code into my application and want to use the "print" feature. However I got "Run time error 91 -- Object variable or with block object not set" with the following code line:

Private Property Get hWnd_Frame() As Long
Dim TWnd As New TWindow

TWnd.hWnd = frmMain.hWnd
TWnd.hWnd = TWnd.FindChildWindowByClass("ATL:", False).hWnd '******Problem occured here**********
If Mid$(TWnd.ClassName, 9, 4) = "2748" Then
TWnd.hWnd = TWnd.FindChildWindowByClass("ATL:", False).hWnd
If Mid$(TWnd.ClassName, 9, 4) = "2070" Then
TWnd.hWnd = TWnd.FindChildWindowByClass("AfxFrameOrView42").hW nd
hWnd_Frame = TWnd.hWnd
End If
End If

End Property

I did set:

Set obiMap = New MapPoint
Set Map = frmMain.MappointControl.Activemap

before I call

objMap.SendCommand MapPointMenu.mnuFile.cmdPrint

Do you have any clues? Any suggestions are appreciated very much!

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
  #6 (permalink)  
Old 02-28-2003
Junior Member
Yellow Belt
 
Join Date: Jan 2003
Posts: 23
David:

What is Windows version your app runs on?
And did the error happen in the original example application?

I've recently found that on some Win98 systems TWindow.FindChildWindow method fails.

It does not happen when a piece of code
in TWindow.FindChildWindow is changed:


If Not TWin.Valid Then
Set TWin = Nothing
End If


To


If TWin.hWnd = 0 Then
Set TWin = Nothing
End If


Try it out!
Sergiy
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 02-28-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Sergiy,

thank you very much for your quick reply.
No luck to get it work. My OS is Windows 2000.
Your original example version works fine.
The only differences is my main form (renamed as frmMain) is much more complicate than yours.

By the way, can you bring up the "More options..." screen of the route planner by using the similar method. I'd like to bring up the screen just by clicking a button, but not on the route planner screen.

Thanks again,

David
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 02-28-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
The problem is that my program will go through the code

If Not TWin.Valid Then
Set TWin = Nothing
End If

Then no object is set for TWin.

Any clues?

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
  #9 (permalink)  
Old 02-28-2003
Junior Member
Yellow Belt
 
Join Date: Jan 2003
Posts: 23
David,

I would suggest that your MapPoint control was not placed directly on your frmMain but rather on some kind of a frame window.

If the container frame name is 'Frame1', for instance, then inside 'Property Get hWnd_Frame' use that object name 'frmMain.Frame1' in place of 'frmMain'.

If it is not your case, and there is indeed an unknown problem with frmMain complexity, then resolve it by creating such a frame (specifically designated to contain MapPoint control in it). Cut and paste MapPoint on the frame and point ''Property Get hWnd_Frame' to it as discussed above.

Hope this should help,
Sergiy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 03-02-2003
Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 45
Sergiy,

thank you very much for your recognization of the problem. You are right, the Mappoint is not on the form directly.

I will try it out following your instruction.

Can you bring up the Window for routing preference by using a similar way? My application wants to set the parameters at the system configuration phase.

David
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
MS Access Mappoint ActiveX Anonymous MapPoint 2006/2009 Discussion 2 05-21-2005 05:31 PM
Re: Keyboard control in mappoint activex control djcapslock MapPoint 2006/2009 Discussion 1 03-10-2005 10:16 AM
MS Access and Mappoint ActiveX Control Anonymous MapPoint 2006/2009 Discussion 3 06-26-2004 01:29 PM
Using MP ActiveX Control in Access/Foxpro etc Anonymous MapPoint 2006/2009 Discussion 0 02-21-2003 11:51 AM
Hi EB Can i use the Map point control features .... Anonymous MapPoint 2006/2009 Discussion 1 05-14-2002 02:03 AM


All times are GMT -5. The time now is 12:39 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 flights to Italy
Italy is overflowing with things to do, things to see and things to eat. Why not book cheap flights to Italy online right now?

Cruise Travel Agent
Travel Counsellors is a leading Cruise Travel Agent. Visit the site to view details of your preferred Cruise Line.

Holidays to Thailand
The best cultures and backgrounds make Thailand an interesting and memorable country to visit. Book great value holidays to Thailand online at dealchecker.co.uk.

Barbados Holidays
Barbados holidays can be a wonderful break from the rat race or an exciting, action packed adventure. Plan the perfect holiday in Barbados.

Cheap Greece Holidays
For cheap Greece holidays make sure you know when to book and who to book with. Visit ulookubook.com to get help with doing both of those things. Why not time your visit with a Greek festival?

Travel Deals
Find the very best travel deals on your prime comparison site, Travel.co.uk

Holidays in Gran Canaria
Have some fun in the sun on the Canary Islands! See On The Beach for information on holidays in Gran Canaria.


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