Community of VE/MapPoint Users and Developers
This is a discussion on QueryPolygon Error within the Development forums, part of the MapPoint 2006/2009 Discussion category; Hi. I am using the ActiveX control that shipped with MapPoint 2006 in a VB.NET 2005 Windows Forms application. I'm ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| QueryPolygon Error I am using the ActiveX control that shipped with MapPoint 2006 in a VB.NET 2005 Windows Forms application. I'm trying to get a recordset containing all the pushpins within the currently displayed portion of the map by plotting out a rectangle that represents the bounds of the map and passing the coordinates to the querypolygon method of the dataset object. The code is below. Dim locations(5) As MapPoint.Location locations(0) = objMap.XYToLocation(0, 0) locations(1) = objMap.XYToLocation(objMap.Width, 0) locations(2) = objMap.XYToLocation(objMap.Width, objMap.Height) locations(3) = objMap.XYToLocation(0, objMap.Height) locations(4) = objMap.XYToLocation(0, 0) Dim objDataSet As MapPoint.DataSet = objMap.DataSets("My Pushpins") Dim objRecordset As MapPoint.Recordset = objDataSet.QueryPolygon(locations) When querypolygon is executed, I get the following message: "The parameter is incorrect." I've looked at a number of examples and played around with the code a bit, but I can't figure out what I'm doing wrong. Anyone have any ideas? Thanks. |
| |||
|
It's a simple problem: Your array of Locations is dimensioned too large. Instead use Dim locations(4) As MapPoint.Location In VB.Net, the zero-base is assumed, so you were actually creating a 6-item array, the last of which was not initialized. HTH -Paul |
![]() |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 12-31-2007 09:50 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| On Error Help - VBA | andriy | Development | 7 | 10-09-2007 10:56 AM |
| Run-time error 2147467259 80004005 automation error | ThomasB | MapPoint 2006/2009 Discussion | 2 | 02-27-2007 11:41 AM |
| About ERROR 4-40028-1. Error or Bug ? | Anonymous | MapPoint 2006/2009 Discussion | 12 | 01-11-2005 09:32 AM |
| I get this following error | ananthdeena | MapPoint 2006/2009 Discussion | 3 | 01-01-2005 02:46 AM |
| vb to c# error question | starbuck | MapPoint 2006/2009 Discussion | 2 | 09-13-2004 09:40 AM |
Borovets Ski
Enjoy the stunning scenery of the Rila Mountains when you book a Borovets Ski Holiday in Bulgaria. Holiday Hypermarket makes price comparison between competitors easy.
Greece Weather
Check Turkey Weather before you travel. We provide information on Turkey including weather, flights and accommodation.
Holiday in Portugal
A holiday in Portugal is low cost but great value when you book with us online. Transportation and accommodation are excellent and very reasonable too.
Mauritius Holidays
Mauritis holidays are a sun drenched, sense tingling experience of a lifetime. You will find bargain deals on many holidays with us!
Cheap Egypt Holidays
Pick up a bargain cheap Egypt holiday online when you visit ulookubook.com. Just check out our tips to make sure you book at the right time to get a great holiday for a great price. Finding cheap Egypt holidays can be simple when you know how.
Price Comparisons
Search and compare millions of holidays, flights and hotels etc. At Travel.co.uk, price comparisons are easy.
Cheap Holidays to Cyprus
Enjoy island nightlife at its best! Book cheap holidays to Cyprus at On The Beach!