Select to view content in your preferred language

Opening a bmp file from within vbs on a PDA platform

722
2
07-07-2010 08:21 AM
MikeCurtis
New Contributor
OK
I'm trying to create some code that will enable a user to open a new bmp file (with automatically generated file name) to enable a sketch to made and captured.
The code I've generated works perfectly on a PC, with a new file with automatically generated filename created, which is then opened by bmp editing software and can then be saved.  The code for editing a specific bmp file also works on a PC with the selected file being opened.

HOWEVER, on a PDA running windows mobile 6 the same code fails to open the specified filename, neither the newly created file nor an existing file for editing.  Instead the Paint software opens with the last image/sketch still displayed, and to save I have to manually enter the system generated filename.  To edit a pre-existing file I have to browse for the relevant file.

Is there any coding amendments that can get around this OS specific issue? 

Here's an extract of the code that works perfectly on a PC, some unnecessary code has been removed for this post. Apologies for my clumsy coding I'm self taught 😮

**************************************

sub AddSketch
dim F1, F2, curStat, RSketch, statID, text, filename, incre_Numb, SketchPath, fSketchFile
dim DirPath, PathLength, exPath, SysID
' create unique sketch filename
set F1 = Application.Map.Layers("fieldata").Forms("EditForm").Pages("Stationinfopage") ' form containing locality information
Set F2 = Application.Map.Layers("fieldata").Forms("FORM30").Pages("PAGE1") ' form controlling sketch function
DirPath = Application.UserProperties("FD_filepath") 'file directory path
curStat = F1.controls("cboregion") & F1.controls("cboyear") & "-" & F1.controls("editStat") ' generates a location identifier
incre_Numb = SketchRecordID() ' function returns an incrementing number for bmp files at present locality
filename = curStat & "(" & incre_Numb & ").bmp" ' generates the .bmp filename

' create .bmp file with unique name then open it
Set fSketchFile = CreateAppObject("File")
SketchPath = DirPath & "sketches\" & filename 'directory path to .bmp file
fSketchFile.Open SketchPath, 2 'Open and write to the end, open with default
fSketchFile.Close
Application.Run(SketchPath) 'opens .bmp file with default application  ****THIS DOES NOT OPEN THE SPECIFIED FILE ON A WINDOWS MOBILE PLATFORM*****
InitiateSketch ' sub that initiates a form to show a list of sketch filenames at present locality
end sub

Any ideas how I can get the code to open a specific file when run on Windows mobile system would be much appreciated.

Mike
Tags (3)
0 Kudos
2 Replies
StephenQuan
Deactivated User
The code will work on your Windows Mobile device if you have installed a program that allows you to edit a .bmp file since that feature isn't included in the Windows Mobile OS.
0 Kudos
MikeCurtis
New Contributor
The code will work on your Windows Mobile device if you have installed a program that allows you to edit a .bmp file since that feature isn't included in the Windows Mobile OS.


I've installed PDApaint, which offers a very similar user experience to MS Paint which isn't available for windows mobile 6 on the device I'm using - Trimble Nomad.
I've set PDAPaint to be the default application, but it doesn't work as directed.

Has anyone created a system that captures sketches?  If so what windows mobile application do you use for editing .bmp files?
0 Kudos