MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




MapPoint 2004 and Visual Studio 2005 Runtime error

This is a discussion on MapPoint 2004 and Visual Studio 2005 Runtime error within the MapPoint 2006/2009 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. ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-24-2006
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()
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 02-24-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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.
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 02-24-2006
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 02-24-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 02-24-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 02-24-2006
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 02-25-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Hi,

Quote:
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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 02-25-2006
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 02-26-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 02-26-2006
Junior Member
White Belt
 
Join Date: Feb 2006
Posts: 6
I have also tried that with MapPoint.exe /RegServer

It made no difference.
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

Tags
2005, error, mappoint 2004, runtime, studio, visual


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
tutorial mappoint in VB6.0 visual studio lucci56 MapPoint 2006/2009 Discussion 1 07-14-2006 09:06 AM
Visual Studio Anonymous MapPoint 2006/2009 Discussion 1 10-15-2004 08:57 PM
visual studio.netq Anonymous MapPoint 2006/2009 Discussion 5 10-31-2003 12:59 PM
MapPoint 2002 ActiveX control and Visual Studio .NET 2003 chulaka MapPoint 2006/2009 Discussion 1 09-30-2003 11:35 AM
Accessing Mappoint 2002 via Visual Studio .NET 2003 Anonymous MapPoint 2006/2009 Discussion 1 08-14-2003 12:01 PM


All times are GMT -5. The time now is 08:44 PM.


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


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