MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Confused with calcpos :s

This is a discussion on Confused with calcpos :s within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I'm using the following to call calcpos to try and grab the long and lat of an address Code: Private ...


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

Today's Posts Twitter Feed 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 09-25-2003
Member
Yellow Belt
 
Join Date: Sep 2003
Posts: 44
Confused with calcpos :s

I'm using the following to call calcpos to try and grab the long and lat of an address
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim objmap As MapPoint.Map
        Dim objLoc As MapPoint.Location
        Dim lat, lon As Double
        objmap = AxMappointControl1.ActiveMap
        objLoc = objmap.FindAddressResults("Moss Lane", "Bolton", "", "", "BL1", "England")
        CalcPos(objmap, objLoc, lat, lon)

    End Sub
But aparently using objloc in that manner is an invalid cast :s any help on this would be greatly appreciated

Cheers

M
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 09-25-2003
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 3,041
Blog Entries: 2
I think FindAddressResults returns an array or set up points. Check the syntax and examples, I think you need an (1) or (0) after it.

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~~
~ Upgrade to MapForums Plus membership ~
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 09-25-2003
Member
Yellow Belt
 
Join Date: Sep 2003
Posts: 44
Aha!!! it did indeed need a (1), cheers but its not assigning the value of long and lat to the values that i declare in teh call, they're being updated as 0.0 and 0.0 when the values within the procedure are actually correct and the update of thte values is going ahead :s

M
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 09-25-2003
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 3,041
Blog Entries: 2
It's possible it's not finding a location with that address? Or try a (0), maybe the index starts at 0 and there is no second location (1).

Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~~
~ Upgrade to MapForums Plus membership ~
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 09-25-2003
Member
Yellow Belt
 
Join Date: Sep 2003
Posts: 44
Its definitly finding the correct long and lat, at the moment i've adjusted it so that in the sub its writing the values to 2 labels. However, the 2 labels that are updated in the button function that calls the calcpos sub are updated as 0. Saying that at the moment its working even though its a dirty solution, I'd just like to figure out why its not returning teh values really. In vb6 there'd usually be a return dbllat, dbllon to do it, but return can't be used within a sub in vb.net apparently :s

M
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
calcpos, confused


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
Spatial Data Import Confused by some .shp files tymitton MapPoint 2006/2009 Discussion 5 10-21-2008 11:41 PM
Some concerns about calcpos sub lucci56 MapPoint 2006/2009 Discussion 5 07-18-2006 10:44 AM
Problems using CalcPos Pete_ADL MapPoint 2006/2009 Discussion 4 06-21-2006 03:12 PM
Use CalcPos on a map with EXISTING pushpins ?? Sonicman_ MapPoint 2006/2009 Discussion 5 02-20-2006 04:05 PM
I am confused Anonymous MapPoint 2006/2009 Discussion 1 01-28-2004 12:45 AM


All times are GMT -5. The time now is 03:14 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Lanzarote Holiday
Enjoy a Lanzarote holiday when you check out the offers on UlookUbook and save cash!



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 55 56 57 58 59