Community of VE/MapPoint Users and Developers
This is a discussion on Cannot CreateObject("MapPoint.Application") within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi Sharoma, I was hoping I could open your project with VS2005, but it is not. However I made new ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
|
Hi Sharoma, I was hoping I could open your project with VS2005, but it is not. However I made new application in VB and copy the relevant part to see what happen. I only changed filenames and made the application visible to see if it works. The only thing I had to do was add the type library to the project, however VS do not show me that it is added (but I dont know mutch of VB). Anyway this peace of code works here: Code: Public Class Form1
Private MyMap As MapPoint.Map
Dim objApp As MapPoint.Application
Private Sub UserControl_Initialize()
On Error Resume Next
objApp = GetObject(, "MapPoint.Application")
If objApp Is Nothing Then
objApp = CreateObject("MapPoint.Application")
MyMap = objApp.OpenMap("C:\Program Files\Microsoft MapPoint Europe\MP2004\Samples\Sales.ptm", False)
If (MyMap Is Nothing) Then
MyMap = objApp.NewMap()
End If
Else
MyMap = objApp.ActiveMap
If MyMap Is Nothing Then
MyMap = objApp.OpenMap("C:\Program Files\Microsoft MapPoint Europe\MP2004\Samples\Sales.ptm", False)
If (MyMap Is Nothing) Then
MyMap = objApp.NewMap()
End If
End If
End If
'objApp.Visible = False
objApp.Visible = True
objApp.UserControl = True
objApp.Activate()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
UserControl_Initialize()
End Sub
End Class
Maybe other people with better knowledge of VB than me can answer here ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Thanks Looking at the line ===> MyMap = objApp.OpenMap("C:\Program Files\Microsoft MapPoint Europe\MP2004\Samples\Sales.ptm", False) I hope you were using MP2006 and not MP2004. As my project works fine with MP2004 but not with MP2006. |
| |||
|
Hi, I forgot this. But just did the same test with MP2006. Same result it run here. I will email the project back together with the executable. Let's see if it run there.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi Wilfried, Unfortunately I only have two options for running the software. (a) VB6 w/sp5 (b) VS2003 When I tried your above code sample in VS2003 it failed to run in MP2006 however it ran fine in MP2004. This makes me think if there is an compatibility issue wrt MP2006 and VB6/VS2003 |
| |||
|
Hi Sharoma, It should work because you are using the type library. But I'm a little out of ideas now. Did you try the executable I sent you together with my project ? Does it run on both mappoint versions ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi Sharoma, Still we are not sure if it is something on your machine or with a VS2003 / VB6 setting. If you want you may send me an *.exe then I try it with MP2004 and then with MP2006 registeres. If this works here then we know it is not VB/VS setting. Unless someone has a better idea ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Cannot CreateObject("MapPoint.Application")
We experienced the same problem with some users who had been running an earlier version of MapPoint (2002 or 2004) on their PC, and then installed MapPoint 2006. After spending some time with Microsoft techs, the problem was discovered to be permissions-related. The solution was as follows: 1. Using RegEdit, change the permissions on HKEY_CLASSES_ROOT\.ptm and HKEY_CLASSES_ROOT\.ptt to Full Access for the Administrator. (to do this, right-click on the .ptm folder under HKEY_CLASSES_ROOT and select "permissions") 2. From command prompt, reregistered MapPoint using the command "C:\Program Files\Microsoft MapPoint\MapPoint.exe" /regserver. The Microsoft tech said that he has seen this more than a few times with users running MP2006 who had previously been running an earlier version. He says that they are checking to see if this is, in fact, a bug with the MP2006 install routine. Good luck! |
| |||
|
Hi There is no object in his control, This is the message i used to receive in Access2003/VBA form integrated with MP2004 whenever i closed the form either manually or programmatically. The form is working fine with all mappoint functionality, but i've to place the control again on the form. This normally occurs when ur OCX control isnt displayed in the ACtive Xcontrols list, however its still there and i'm now stuck why it happens. Any help would be greatly appreciated. many thanks. AUR |
| |||
| Re: Cannot CreateObject("MapPoint.Application")
Hi, You cannot create object 'mappoint application' in parallel with the activeX control on a form.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Acc2003 - Mappoint 2006 TimeOut - MS-Office-Forum | This thread | Refback | 12-24-2007 03:24 AM | |
| Acc2003 - Mappoint 2006 TimeOut - MS-Office-Forum | This thread | Refback | 01-18-2007 03:55 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MapPoint 2004 Active-X control: how to "bump" pus | citrix_99301 | MapPoint 2006/2009 Discussion | 3 | 03-18-2006 03:50 AM |
| Mappoint exception "Call was rejected by callee" | jliao81 | MapPoint 2006/2009 Discussion | 1 | 06-03-2005 08:53 AM |
| Do I need "Autoroute Europe", if I install "M | bigtail | MapPoint 2006/2009 Discussion | 1 | 03-24-2004 12:58 AM |
| MapPoint "Fleet Application" definition | Anonymous | MapPoint 2006/2009 Discussion | 5 | 08-26-2003 03:16 PM |
| "Microsoft Mappoint" writing and Pushpin Highligth | feanor | MapPoint 2006/2009 Discussion | 0 | 03-12-2003 05:47 AM |