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
Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

This is a discussion on Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional within the Development forums, part of the MapPoint Desktop Discussion category; Hai friends, I started working with Microsoft MapPoint Control 9.0 and Microsoft MapPoint Object Library 9.0(North America) for a Windows ...

  1. #1
    prasadvp is offline Junior Member Yellow Belt
    Join Date
    Jul 2011
    Posts
    13

    Unhappy Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    Hai friends,
    I started working with Microsoft MapPoint Control 9.0 and Microsoft MapPoint Object Library 9.0(North America) for a Windows Forms Application in C#. I have MapPoint 2002 installed on my system running Windows 7.0 professional. The same application was under development in Windows XP Professional running system and was working fine and continiuing my application development. But after I moved to a better configured system with Windows 7 Professional problems started. First of all the MapPoint Control is not coming correctly on the Windows Form in design time and it is shown as a tiny little thing on the top left corner of the Form when it is dragged from the Tool Box. It is too small that we can't even select it on the form in design time. With that if I start debugging it is showing the following error at runtimeIn Exception Helper)

    ArgumentException was unhandled.
    MapPoint failed to load. The cause of this failure is unknown.

    Please help me to fix this dreaded error as it is really taking my time and not able to move forward with the application development using the MapPoint Control 9.0. Please help ASAP. Thanks in advance.

  2. #2
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    Sorry I don't know, maybe someone else in here is familiar with the issue.

    My gut says that if you are unable to use a more recent version of MapPoint, then maybe you should try to get your old development environment back.

    I'm sure there were many bug and compatibility fixes in the last several versions of MapPoint to ensure it worked with the latest tools and OS's, so MapPoint 2002 would really not be supported anymore, but if it worked with your old development environment, then great, but you would be stuck with that.

    Sorry can't be more help.

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  3. #3
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    Hello PrasadVP,

    There is a property in the project that you may not have been aware of called 'Make COM-Visible.'
    That may well be the answer for you.
    We are available for consulting work should you require individual attention.
    Michael R Mattys
    Business Process Developers
    www.mattysconsulting.com

  4. #4
    Loftis is offline Junior Member White Belt
    Join Date
    Jul 2011
    Location
    Southeast US
    Posts
    8

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    This is the same problem I see with Win7 VS2010 and Mappoint 11.0 control. MP Control VS2010 Win7 Fails

    I am still searching for a solution as well. I have found several posts relating to the Binary not setting the DEP bit correctly and you can fix that with a post-build command line script defined in your project. So far any combination of those post build commands hasn't worked for me.

    I understand the Windows 7 VS2010 descriminates against some ActiveX controls but you would think that their own ActiveX controls would work!!!

    I plan to test the Mappoint 2011 control sometime this week just to see if it works in VS2010 Win7. This is not a good solution for me either as I have many MP 11.0 solutions out there.

    I will let you know if I stumble on a solution if you will please do the same. PS. I tried the Assembly setting Making ComVisible to True and it does not change anything. Still fails on loading.

  5. #5
    Loftis is offline Junior Member White Belt
    Join Date
    Jul 2011
    Location
    Southeast US
    Posts
    8

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional


    Executing the following command on the YourProgram.exe file allows it to run and load without error. However, It doesn't fix the sizing problem when dragging from the tool menu and sizing on the form.

    To test that it might allow your program to run -> Right click on your programs project in the solution explorer and choose 'command prompt'. Browse down into your release directory and execute the following command on your executable:
    editbin.exe /NXCOMPAT:NO YourProgram.exe
    Then execute it from the command line.

    That sets the DEP bit on the executable to allow it to run. You still cannot run or debug your application from within VS2010 so this is not a good solution but it does point to a DEP issue.
    The post I got this info from:
    http://jtstroup.net/post/Attempted-t...s-corrupt.aspx

    I am still looking for a better solution.


  6. #6
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    There are more problems with building the right interface files for MapPoint 9 & 11. I believe I tried it many years ago, and there were compatibility problems - hence I worked with MapPoint 13 (2006) which then supports all later versions.

    MapPoint 2002 was released in 2001 - 10 years old and map data that is even older.


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  7. #7
    XAlliedYouthX is offline Junior Member White Belt
    Join Date
    Aug 2010
    Posts
    5

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    I just discovered this same issue a few hours ago. I've had been doing my VB development in Visual Studio 2005 with Map Point 2004 with no issues for the past few years. Now I'm using Visual Studio 2010 with Map Point 2004 and I'm having the same symptoms as you guys, getting the "MapPoint failed to load. I've already tried Map Point 2011 and that didn't make any difference. The cause of this failure is unknown" error and the control being tiny in the top left of the form. I've tried changing the DEP but that didn't make a difference. The most progress I have had it setting "Enable unmanaged code debugging" on the Debug tab of the project but that only lets the project debug and still doesn't fix the IDE issues.

  8. #8
    prasadvp is offline Junior Member Yellow Belt
    Join Date
    Jul 2011
    Posts
    13

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    Hai,
    As I faced probelms with loading the MapPoint 9.0 control in C# windows forms in Windows 7 Professional I am sticking with WinXP and VS2010 C# dev environment.
    Now there is another issue as described below.
    I am trying to set the locations on the MapPoint control on my Windows Forms in C# application. The following code is what I am trying:

    publicpartialclassfrmMaps : Form
    {
    privateString _loc = String.Empty;
    privateString[] _locs;
    public frmMaps()
    {
    InitializeComponent();
    }
    public frmMaps(string loc)
    {
    InitializeComponent();
    this._loc = loc;
    }
    public frmMaps(string [] locs)
    {
    InitializeComponent();
    this._locs = locs;
    }

    private
    MapPointApp.Application MPApp;
    private MapPoint.DataSet MDataSet;
    private MapPoint.DataSets MDataSets;
    private MapPoint.DataMap MDataMap;
    private MapPointApp.Location MLoc;
    private MapPointApp.Pushpin MPin;
    private MapPointApp.Map MMap;
    private MapPointApp.FindResults MFindResults;
    private MapPoint.Field mField;
    privateString strDataSource;

    private MapPoint.Map oMap;
    private MapPoint.Route oRoute;
    private MapPoint.Waypoints oWaypoints;
    private MapPoint.FindResults oResults;
    private MapPoint.Waypoint StartPoint;
    private MapPoint.Waypoint MidPoint1;
    private MapPoint.Waypoint MidPoint2;
    private MapPoint.Waypoint EndPoint;
    private System.Collections.IEnumerator item; //System.Collections.IEnumerator

    privatevoid frmMaps_Load(object sender, EventArgs e)
    {
    MPApp =
    new MapPointApp.Application();
    string sVersion = MPApp.Version;
    string objTemplate =
    "C:\\Program Files\\Microsoft MapPoint\\Templates\\New North American Map.ptt";
    axMappointControl1.NewMap(objTemplate);
    MMap = (MapPointApp.
    Map)axMappointControl1.ActiveMap;
    int i;
    for (i = 0; i < this._locs.Length; i++)
    {
    //MessageBox.Show(this._locs[i]);
    MFindResults = MPApp.ActiveMap.FindAddressResults("", this._locs[i],"NY","","", MapPoint.GeoCountry.geoCountryUnitedStates);

    string rq = Convert.ToString(MFindResults.ResultsQuality);
    int j=0;
    //if (rq == "geoFirstResultGood") //geoAmbiguousResults
    //{
    for (j = 0; j < MFindResults.Count; j++)
    {
    MLoc = (MapPointApp.
    Location)MFindResults[j];
    MPin = MMap.AddPushpin(MLoc,
    this._locs[i]);
    }
    //}
    }
    }

    In the above code,I am getting the following error in the exception helper at run time at the red coloured line as:

    COMException was unhandled.
    The requested member of the collection does not exist. Use a valid name or index number.

    There is no compilation errors and at run time this error comes. Already spent about 2 days to find a fix to this but still the same error keep coming. Please help me ASAP as I am stuck with this.

  9. #9
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    This is just a guess, but maybe the array starts at 1 instead of 0? I think the adjustment would be something like this

    for (j = 1; j < MFindResults.Count + 1; j++)

    by the way, I'd recommend the book Programming MapPoint in .NET for a lot of MapPoint C# code examples.
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  10. #10
    prasadvp is offline Junior Member Yellow Belt
    Join Date
    Jul 2011
    Posts
    13

    Re: Problem with MapPoint 9.0 Control in C# Windows Forms Application(VS 2010) running Windows 7 Professional

    Hai friends,
    Thanks a lot Eric. I tried ur changes and its working now. But now another error is coming in the next lineof code.I tried the commented line also but the same error.

    MPin = MMap.AddPushpin(MLoc, this._locs[i]);
    //MPin = MMap.AddPushpin(MLoc,"" );

    COMException was unhandled.
    Error HRESULT E_FAIL has been returned from a call to a COM component.

    Please help me. Thanks in advance.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Registry Error Installing 2006 Version in Windows 7 Professional
    By spar74 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-11-2010, 02:12 AM
  2. Replies: 1
    Last Post: 03-26-2009, 08:25 AM
  3. Running a .map file in windows configured Mapserver
    By Elen_99 in forum Other Mapping Platforms
    Replies: 1
    Last Post: 11-25-2008, 07:35 AM
  4. API Reference for Mappoint 2006 Windows Forms Control
    By sh856531 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-06-2007, 05:56 AM
  5. Running VB6 on windows XP - unexpected error; quitting
    By testuser14 in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-15-2005, 11:20 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 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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94