MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Cannot CreateObject("MapPoint.Application")

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 ...


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 (2) Thread Tools Display Modes
  2 links from elsewhere to this Post. Click to view. #11 (permalink)  
Old 10-11-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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
I also see that your project is containing an *.ocx with same name as *.ctl file. And then the function name 'UserControl_..'. Maybe this has something to do with the error ?

Maybe other people with better knowledge of VB than me can answer here ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12 (permalink)  
Old 10-11-2006
Junior Member
White Belt
 
Join Date: Oct 2006
Posts: 8
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13 (permalink)  
Old 10-12-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14 (permalink)  
Old 10-12-2006
Junior Member
White Belt
 
Join Date: Oct 2006
Posts: 8
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15 (permalink)  
Old 10-12-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16 (permalink)  
Old 10-12-2006
Junior Member
White Belt
 
Join Date: Oct 2006
Posts: 8
I cannot run your Application as it requires .NET 2. Where as I only have VS.NET2003

However your earlier sample project code works okay in MP2004 but not in MP2006
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17 (permalink)  
Old 10-12-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
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 ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18 (permalink)  
Old 10-19-2006
Junior Member
Yellow Belt
 
Join Date: Nov 2004
Posts: 17
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19 (permalink)  
Old 12-28-2006
AUR AUR is offline
Junior Member
White Belt
 
Join Date: Dec 2006
Posts: 11
Unhappy Re: Cannot CreateObject("MapPoint.Application")

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #20 (permalink)  
Old 12-29-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Re: Cannot CreateObject("MapPoint.Application")

Hi,

You cannot create object 'mappoint application' in parallel with the activeX control on a form.
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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/cannot-createobject-mappoint-application-5256.html

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

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


All times are GMT -5. The time now is 03:30 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