MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Problem with ObjectsFromPoint

This is a discussion on Problem with ObjectsFromPoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I'm having trouble with the ObjectsFromPoint method. The following code throws an exception whenever there is a TextBox "under" ...


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 10-07-2005
Junior Member
White Belt
 
Join Date: Oct 2005
Posts: 5
Problem with ObjectsFromPoint

Hi,
I'm having trouble with the ObjectsFromPoint method. The following code throws an exception whenever there is a TextBox "under" the x, y.

MapPoint.FindResult fr = axMappointCtrl.ActiveMap.ObjectsFromPoint(x,y)
foreach(object o in fr)
{
Debug.Writeline("Doing nothing...");
}

The method is fine as long as there is no textBox returned to the fr collection.

When it is, the following exeption stack can be traced:

at System.Runtime.InteropServices.Marshal.ThrowExcept ionForHR(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExcept ionForHR(Int32 errorCode)
at System.Runtime.InteropServices.CustomMarshalers.En umeratorViewOfEnumVariant.GetNextElems()
at System.Runtime.InteropServices.CustomMarshalers.En umeratorViewOfEnumVariant.MoveNext()


Please, can anyone help me with this?

//pobe
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 10-10-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

What is the offending line of code ?
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 10-11-2005
Junior Member
White Belt
 
Join Date: Oct 2005
Posts: 5
Hi,

I read this on a Microsoft page, guess this is what happens in my code.


Quote:
The Map.ObjectsFromPoint method sometimes creates an invalid FindResults object. The count of the results is larger than the actual number of found items
To answer your question: The exception is thrown in the foreach loop and since I don't do anythin in it it is the iteration itself that fails.

/pobe
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 10-13-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

Thanks for feedback. This is probably the reason.
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
objectsfrompoint, problem


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
I loose a lot of street names with ObjectsFromPoint(X,Y) Anonymous MapPoint 2006/2009 Discussion 2 12-17-2004 10:06 AM
ObjectsFromPoint: no other solutions ? Alexoff MapPoint 2006/2009 Discussion 0 02-05-2003 04:54 AM


All times are GMT -5. The time now is 06:52 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

Thassos Holidays
Visit an unspoilt and beautiful Greek island with Thassos holidays available through UlookUbook.



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