MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




c#.. Exception (simple code and method)

This is a discussion on c#.. Exception (simple code and method) within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Code: ViewByHeightWidth[] myViews = new ViewByHeightWidth[1]; myViews[0] = new ViewByHeightWidth(); myViews[0].CenterPoint = new LatLong(); myViews[0].CenterPoint.Latitude = 40; myViews[0].CenterPoint.Longitude = -120; ...


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-24-2005
Junior Member
White Belt
 
Join Date: May 2005
Posts: 8
c#.. Exception (simple code and method)

Code:
ViewByHeightWidth[] myViews = new ViewByHeightWidth[1];
myViews[0] = new ViewByHeightWidth();
myViews[0].CenterPoint = new LatLong();
myViews[0].CenterPoint.Latitude = 40;
myViews[0].CenterPoint.Longitude = -120;
myViews[0].Height = 200;
myViews[0].Width = 300;

Pushpin[] myPushpins = new Pushpin[1];
myPushpins[0] = new Pushpin();
myPushpins[0].IconDataSource = "MapPoint.Icons";
myPushpins[0].IconName = "3";
myPushpins[0].LatLong = myViews[0].CenterPoint;
myPushpins[0].Label = "Center";
myPushpins[0].LabelNearbyRoads = true;

MapSpecification mapSpec  = new MapSpecification();
mapSpec.DataSourceName = "MapPoint.NA";
mapSpec.Views = myViews;
mapSpec.Pushpins = myPushpins;

render = new RenderServiceSoap();
render.Credentials = new System.Net.NetworkCredential(User,Pass);
render.PreAuthenticate=true;

MapImage[] mapImages = render.GetMap(mapSpec);
						
Bitmap bMap = new Bitmap(new System.IO.MemoryStream(mapImages[0].MimeData.Bits));
						
pictureMapPoint.Image=bMap;
I'm working in a Pocket Application and there is an exception in this line
Code:
Bitmap bMap = new Bitmap(new System.IO.MemoryStream(mapImages[0].MimeData.Bits));

This same code works fine in a WindowsApplication, but not in the Pocket application tha I need.

Does anyone know why?? can you prove this method??

Please help me..

thanks..
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-26-2005
Junior Member
Yellow Belt
 
Join Date: Feb 2005
Posts: 19
Hi,

I think this is more a .NET compact framework (i'm assuming that you are using that?) problem than an mappoint issue.
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-26-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

Possible some of the functions does just not work on pocket pc. If your application work on windows then it seems ok to me, if it does not work on pocket pc then some of the functions are just not pocket compatible. I'm sorry if this does not give any help
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

Similar Threads

Thread Thread Starter Forum Replies Last Post
OutOfMemory Exception Gianmaria MapPoint 2006/2009 Discussion 1 01-24-2006 12:26 PM
Regarding COM exception at the end of execution... Anonymous MP2K Magazine Articles 0 05-12-2005 12:23 PM
AddPushPin() throws exception in VC++ radboudp MapPoint 2006/2009 Discussion 2 01-20-2005 06:49 PM
Unknown Host Exception amitsh MapPoint 2006/2009 Discussion 2 11-03-2004 11:18 PM
Simple VB6.0 code for Map Point 2002 danleybell MapPoint 2006/2009 Discussion 1 09-25-2002 05:57 PM


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

Flights to Germany
For flights to Germany book online with Holiday Hypermarket. Why not book some great value accommodation too? Check out how easy it is.

Italy Weather
Check Italy Weather before you travel. We provide information on Italy including weather, flights and accommodation.

Cheap Holiday Turkey
Booking a cheap holiday to Turkey doesn't have to be at the expense of enjoyment. Dealchecker.co.uk searches holidays from the leading UK Tour Operators.

Holidays to Barbados
Holidays to Barbados have so much to offer. Enjoy the beauty of this Caribbean island for less by booking your holiday through us.

Spain
Spain is such a diverse country that it has something to offer most holidaymakers. Finding delicious cuisine is no challenge and the shopping ranges from designer boutiques to unknown flea markets. Spain has much to offer.

Cheap Holiday
For the holiday of your life that is cheap enough to afford with ease, visit Travel.co.uk

Cheap Portugal Holidays
Hotels of all ratings! Find information on cheap Portugal holidays 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