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 2 12 LastLast
Results 1 to 10 of 11

MapPoint 2004 and Visual Studio 2005 Runtime error

This is a discussion on MapPoint 2004 and Visual Studio 2005 Runtime error within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi, I'm new to MapPoint and quite new to VB.Net. I am trying to create a very simple test application. ...

  1. #1
    tizer001 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    6

    MapPoint 2004 and Visual Studio 2005 Runtime error

    Hi,
    I'm new to MapPoint and quite new to VB.Net.

    I am trying to create a very simple test application. I have added the reference to Microsoft MapPoint 11.0 Object Library and have the following vb.net code

    Dim app As MapPoint.Application
    app = New MapPoint.Application()
    Dim map As MapPoint.Map = app.ActiveMap


    I get a runtime error (see below) when the program gets to the second line of code. I have searched Google for hours now trying to find a solution and have had no luck at all. Does anyone have any ideas?


    Thanks.


    This is the error message displayed:-

    Retrieving the COM class factory for component with CLSID {15A40122-24D2-4FDB-8155-5F65FCE7017F} failed due to the following error: 80040154




    This is the detailed error:-

    System.Runtime.InteropServices.COMException was unhandled
    ErrorCode=-2147221164
    Message="Retrieving the COM class factory for component with CLSID {15A40122-24D2-4FDB-8155-5F65FCE7017F} failed due to the following error: 80040154."
    Source="Calculate Distance v1"
    StackTrace:
    at Calculate_Distance_v1.Form1.btnMapPoint_Click(Obje ct sender, EventArgs e) in C:\Documents and Settings\dave\My Documents\Visual Studio 2005\Projects\Calculate Distance v1\Calculate Distance v1\Form1.vb:line 40
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
    at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
    at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(ApplicationCo ntext context)
    at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
    at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
    at Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine)
    at Calculate_Distance_v1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
    at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
    at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
    at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
    at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()

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

    I have no idea at the moment, but a simple experiment can probably show if all installations are OK. Just create a new winform application, drop a mapppoint activeX control on your main form and see if it load.

    if it run OK, and you can open a map then we are at least sure of search path, installation, etc.

  3. #3
    tizer001 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    6
    Hi,
    I created the ActiveX control on the form and ran it and it did nothing.
    So I added this code:-

    AxMappointControl1.NewMap(MapPoint.GeoMapRegion.ge oMapEurope)


    And I get this error:-

    MapPoint Europe can't run because it is not registered on your system, or it can't be found. Install MapPoint Europe and try again.

    MapPoint is installed and it does seem to run ok.
    Should I try a reinstall?

    Note: MapPoint is not installed on Drive C:
    Due to space limitations I installed it on a spare harddrive U:
    Would that cause problems?

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

    Could be that different drive is an untested situation.

    A simple test is maybe to use OpenMap and give the rith path with it including the drive. Like this (with exact your path of course):
    Code:
    MP.OpenMap('U:\Program Files\Microsoft MapPoint Europe\MP2004\Templates\New European Map.ptt', False);
    If that helps, I suggest to search in registry for MP or MapPoint or .ptm and related things to see if drive letters are associated.

  5. #5
    tizer001 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    6
    Hi Wilfried,
    I gave that a try and it gave an error saying the file was not a MapPoint file.
    I am going to uninstall and re-install to drive C after some space cleaning.

    I will post to say whether it makes any difference.

    Thank You.

  6. #6
    tizer001 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    6
    Re-Install to Drive C made no difference.

    Any suggestions.

    The only thing I can think of is that I installed VS 2005 first and then MapPoint. Would that make any difference?

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

    I gave that a try and it gave an error saying the file was not a MapPoint file.
    Then there is something else wrong. What if you run mappoint.exe and open the same file with it ?

  8. #8
    tizer001 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    6
    If I run MapPoint and open the template file it functions just as expected with no errors.

    I have re-installed Visual Studio 2005 and it made no difference. I have re-installed the .Net Framework (this was forced after re-installing Visual Studio). I have tried using Visual Studio 2003 which gives me this error:-


    An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in MapPointTest.exe

    Additional information: COM object with CLSID {15A40122-24D2-4FDB-8155-5F65FCE7017F} is either not valid or not registered


    I'm pretty much out of ideas.

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

    I'm pretty mutch also out of ideas. Can you try to register the component manually. I think it is with /RegServer command line argument.

  10. #10
    tizer001 is offline Junior Member White Belt
    Join Date
    Feb 2006
    Posts
    6
    I have also tried that with MapPoint.exe /RegServer

    It made no difference.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. tutorial mappoint in VB6.0 visual studio
    By lucci56 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-14-2006, 09:06 AM
  2. Visual Studio
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-15-2004, 08:57 PM
  3. visual studio.netq
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 10-31-2003, 12:59 PM
  4. MapPoint 2002 ActiveX control and Visual Studio .NET 2003
    By chulaka in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-30-2003, 11:35 AM
  5. Accessing Mappoint 2002 via Visual Studio .NET 2003
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-14-2003, 12:01 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 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 95 96