Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

c#.. Exception (simple code and method)

This is a discussion on c#.. Exception (simple code and method) within the MapPoint Desktop 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; ...

  1. #1
    luisfdo is offline 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..

  2. #2
    Jeurink is offline 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.

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Unknown Host Exception
    By amitsh in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 12-19-2008, 01:39 AM
  2. OutOfMemory Exception
    By Gianmaria in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-24-2006, 01:26 PM
  3. Regarding COM exception at the end of execution...
    By Anonymous in forum MP2K Magazine Articles
    Replies: 0
    Last Post: 05-12-2005, 01:23 PM
  4. AddPushPin() throws exception in VC++
    By radboudp in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-20-2005, 07:49 PM
  5. Simple VB6.0 code for Map Point 2002
    By danleybell in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-25-2002, 06:57 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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