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 10 of 10

"The parameter is incorrect"

This is a discussion on "The parameter is incorrect" within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi all I have developped an application that uses the MapPoint control (2002). It works fine on my development station ...

  1. #1
    Jaba is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    21

    "The parameter is incorrect"

    Hi all

    I have developped an application that uses the MapPoint control (2002). It works fine on my development station (XP PRO) and another XP PRO machine also... But on a 3rd machine I get the exception "the parameter is incorrect" when it needs to show a map in the control...

    I don't understand why... I think It is a problem with Windows XP Pro but I'm not sure...

    Here is the function that causes the error (on one machine only) :

    Code:
    			try 
    			{
    				MapPoint.Map mpmap = this.axMappointControl1.ActiveMap;
    
    
    				object temp = "Navigation";
    				MapPoint.Toolbar toolbar = this.axMappointControl1.Toolbars.get_Item(ref temp);
    				toolbar.Visible = true;
    
    
    				int i=0;
    
    				while ( (g_dLat[i] != -1) && (g_dLong[i] != -1) )
    				{
    					mpmap = this.axMappointControl1.ActiveMap;
    					mploc[i] = mpmap.GetLocation(g_dLat[i], g_dLong[i], 1);
    					if(i==0) mploc[i].GoTo();
    
    					MapPoint.Shape sh = null;
    
    					if (bLinkedByLine == true)
    					{
    						if(i>0)
    						{
    							sh = mpmap.Shapes.AddLine(mploc[i-1], mploc[i]);
    							sh.Line.Weight= 1;
    						}
    					}
    
    					MapPoint.Pushpin pp = null;
    					pp = mpmap.AddPushpin(mploc[i], i.ToString());
    					pp.Symbol = iSymbol;
    
    					i++;
    				}
    
    
    				mpmap.ZoomOut();
    				mpmap.ZoomOut();
    			}
    			catch(Exception ex)
    			{
    				MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning);
    			}

    I'm sure that it is not a error in code that causes the error, because this application has been tested during one month and it has never shown this exception... It should be specific to the windows XP pro machine... But what on this computer can cause this ?

    Thank you.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Is mappoint correct installed and can open his maps ?
    What is the offending line of code ?

  3. #3
    Jaba is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    21
    Yes, the MapPoint application works well. Also, the dll files are in the same folder (as in other installations).
    I know the error is in the while{} block. I'm going to find exactly where.

  4. #4
    Jaba is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    21
    The error happens exactly on the following line of code :

    Code:
    					mploc[i] = mpmap.GetLocation(g_dLat[i], g_dLong[i], 1);
    I really don't understand why this error happens only on one XP machine !

    Also, in system event viewer I have the following information (not sure it is related to my problem) :

    Code:
    Event Type:	Information
    Event Source:	Service Control Manager
    Event Category:	None
    Event ID:	7035
    Date:		2/11/2005
    Time:		5:09:30 PM
    User:		MP2002CLT0001A\admin
    Computer:	MP2002CLT0001A
    Description:
    The WMI Performance Adapter service was successfully sent a start control.
    
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

  5. #5
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Can you examine (log somewhere) the values of g_dLat[i] and g_dLong[i] to try them out manually ? Also you sure you dont have array bound overflow in mploc[i] ?

    Also what is exacly the error message ?

    is the datetime in event viewer exacly same as when you get the error ?

  6. #6
    Jaba is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    21
    Quote Originally Posted by Wilfried
    Hi,

    Can you examine (log somewhere) the values of g_dLat[i] and g_dLong[i] to try them out manually ? Also you sure you dont have array bound overflow in mploc[i] ?

    Also what is exacly the error message ?

    is the datetime in event viewer exacly same as when you get the error ?

    The values for g_dLat[i] and g_dLong[i] are normal values. There is no array bound overflow in mploc[i].

    I remind you that this application is installed on 3 XP PRO machines. It works very well on 2 machines (never one bug, everything OK since one month) but EXACTLY the same application cannot draw anything on the map on a 3rd machine.

    The error message is only "The parameter is incorrect". This is just the error given by the application. And the Exception.Source value is the line or code that I gave you.

    The datetime is exactly the good one (I open event viewer then execute my application and when a map must be displayed there's the log that is added in event viewer).

    I wonder if this is not a COM/DCOM problem... But the normal MapPoint 2002 application works very well in standalone...

  7. #7
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    I have seen that error but just recall when. I think it was when I was feeding mappoint with csv files, containing a latitude/longitude with different decimal separator as in the windows settings. Changed the locales fixed this.

    So since this is typical in particular machine, I suggest to check all locales, specially the number format (decimaseparator, thousandseparator), datetime formats etc... if they are different as on the 2 other machines.

  8. #8
    Jaba is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    21
    I'm going to check these parameters...

    Thank you very much Wilfried

  9. #9
    Jaba is offline Junior Member Yellow Belt
    Join Date
    Jan 2005
    Posts
    21
    GREAT !!! I defined the regional settings as on the two other computers... And this works !! Thanks again Mister Wilfried !!!

  10. #10
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Great ! I'm glad it is solved for you

    Can you please tell something more because this can benefit others. I assume this code line:
    Code:
    mploc[i] = mpmap.GetLocation(g_dLat[i], g_dLong[i], 1);
    is about double so nothing to do with regional settings. Is there something else where you feed mappoint with ?

    If not, what are the settings where it was not working with ?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. printing: the parameter is incorrect if not geoPrintMap
    By Wilfried in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 11-19-2005, 03:16 AM
  2. Error "overflow execution stack" while readinq a
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 02-18-2005, 02:47 PM
  3. How can I open "Show or Hide places" in program
    By Chester in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-26-2004, 09:12 PM
  4. Do I need "Autoroute Europe", if I install "M
    By bigtail in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-24-2004, 12:58 AM
  5. Export "Find nearby places" along a route?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 11-06-2003, 10:56 AM

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 26 27