Thread: VB.net Calcpos
View Single Post

  #4 (permalink)  
Old 10-17-2007
Winwaed's Avatar
Winwaed Winwaed is offline
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 785
Blog Entries: 4
Re: VB.net Calcpos

Your longitude and latitude ordinates are defined as "byval". You must use ByRef. I assume that is what it is called in VB.Net - it is in VB6 (C# uses 'ref' and 'out').

byval is one way - data is passed into the function, but nothing is passed back.

It is also good practice to use 'byref' for object parameters (eg. the location and map objects).
This removes unnecessary copying/etc. (I'm not sure if I would trust a MapPoint.Map object that has been deep-copied)

Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009
Reply With Quote