MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Error opening ptm file

This is a discussion on Error opening ptm file within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi everyone. I'm new to Mappoint and have just added MP routing to an application I am developing. I have ...


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

Today's Posts Twitter Feed 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 12-14-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Error opening ptm file

Hi everyone. I'm new to Mappoint and have just added MP routing to an application I am developing. I have successfully created the ptm file but when I try to open it from my app, I get "The file does not exist in the specified location". I know the path is correct and that the file is there. I'm running the app from the VS.NET IDE. Here's the code that saves and opens the file:

If sPtmFile = "" Then
Randomize()
iTemp = Int((1000000 * Rnd()) + 1)
sPtmFile = Trim(Application.StartupPath) & "\TempMaps\TempMap" & CStr(iTemp) & ".ptm"
End If

If sOpenWith = "Mappoint" Then
oApp.ActiveMap.SaveAs(Filename:=sPtmFile)
oApp.ActiveMap.Saved = True
oApp.Quit()
SysProc.Start("Mappoint.exe", sPtmFile)
End If

The error occurs when the SysProc funtion attemps to start MP and open the file. I've checked the value of sPtmFile a hundred times and I know it's correct. I can also find the file in Windows Explorer and dblclick it to open it with MP, or open MP and do File->Open on it, so I know there's nothing wrong with the file. Any help you can give me I would appreciate.
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 12-14-2004
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Is it missing a backslash after TempMap?

sPtmFile = Trim(Application.StartupPath) & "\TempMaps\TempMap" & CStr(iTemp) & ".ptm"


sPtmFile = Trim(Application.StartupPath) & "\TempMaps\TempMap\" & CStr(iTemp) & ".ptm"
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 12-15-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thanks for responding John, but actually "Tempmap" is part of the filename, then I add a random number and the ptm extension. An example is:

c:\Program Files\MyApp\TempMaps\TempMap123456.ptm

where the "c:\Program Files\MyApp" would be the Application.StartupPath.
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 12-22-2004
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Why not open mappoint (if not already open) and use the open map method?

Here are the samples from the helpfile.

Code:
'Assume the MappointControl on your form is named "MappointControl1"

  Private Sub Form_Load()
    'Assume the file exists in the default directory
    MappointControl1.OpenMap "Clients.ptm"
  End Sub
Code:
Sub OpenSampleMap()

  Dim objApp As New MapPoint.Application

  'Set up application
  objApp.Visible = True
  objApp.UserControl = True

  'Open a sample map
  objApp.OpenMap objApp.Path + "\Samples\Clients.ptm"

  End Sub
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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
error, file, opening, ptm


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
Opening an application from hyperlink of Pushpin Anonymous MapPoint 2006/2009 Discussion 4 03-14-2005 05:21 AM
Opening a 2000 file FDPoint MapPoint 2006/2009 Discussion 0 06-03-2004 06:35 AM
Error..cant find file Anonymous MapPoint 2006/2009 Discussion 0 05-20-2004 02:18 PM
Error on importing shape file Anonymous MapPoint 2006/2009 Discussion 1 06-26-2003 10:26 AM
Opening a new map takes about 10 sec ?!?!?! Anonymous MapPoint 2006/2009 Discussion 1 07-25-2002 12:43 PM


All times are GMT -5. The time now is 02:56 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Florida Holiday
Book your Florida holiday through UlookUbook and save cash!



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