MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




findNearbySpec... c# problem

This is a discussion on findNearbySpec... c# problem within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Code: FindResults foundResults; foundResults = findService.FindNearby(findNearbySpec); ViewByHeightWidth[] views = new ViewByHeightWidth[1]; views=null; views[0] = foundResults.Results[0].FoundLocation.BestMapView.ByHeightWidth; I have this exception Object ...


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 05-25-2005
Junior Member
White Belt
 
Join Date: May 2005
Posts: 8
findNearbySpec... c# problem

Code:
FindResults foundResults;
foundResults = findService.FindNearby(findNearbySpec);
ViewByHeightWidth[] views = new ViewByHeightWidth[1];
views=null;
views[0] = foundResults.Results[0].FoundLocation.BestMapView.ByHeightWidth;
I have this exception Object reference not set to an instance of an object.

I cannot find the problem... There are many places found in foundResults

can you help me?
Thank you..
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 05-25-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
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 05-25-2005
Junior Member
White Belt
 
Join Date: May 2005
Posts: 8
hi..

the problem is this line

Code:
views[0] = foundResults.Results[0].FoundLocation.BestMapView.ByHeightWidth;
Gracias..
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 05-26-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

You set views = null; before you assign something to views[0]. You cannot assign to a null pointer. Probably that's the reasonl.

Somtthing like this is better I think:

Code:
FindResults foundResults;
foundResults = findService.FindNearby(findNearbySpec);
ViewByHeightWidth[] views = new ViewByHeightWidth[1];
// views=null; in comment
if (foundResults)
    views[0] = foundResults.Results[0].FoundLocation.BestMapView.ByHeightWidth;
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


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

Short Break Ski Holidays
Just want to book a short break? Short break ski holidays become great value when you book at Holiday Hypermarket. See the range of deals on offer.

Portugal Holidays
Find and book Portugal Holidays with Travel Counsellors. Holiday destinations around the world including Portugal.

Italy Holiday
An Italy Holiday is full of interesting stuff for the casual tourist and even more for the educated visitor. Check out the latest great deals at dealchecker.co.uk.

Dominican Republic Holidays
Dominican Republic holidays have something to offer for everyone. From water sports, to sun bathing and more, enjoy a holiday there!

Egypt
In Egypt you find an ancient city buzzing with life. There is an abundance of historical sites to see, not just the pyramids. The Opera House is certainly worth a visit and you can enjoy some open-air theatre too.

Cheap family holidays
To plan cheap family holidays, use Travel.co.uk to explore all the delightful possibilities that there are.

Cheap Holidays to Sharm el Sheikh
Break away to Northern Africa. Find cheap holidays to Sharm el Sheikh at On The Beach.


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