Steve,

Wordpad is not something windows will run without a full path (whereas
notepad is). this is a pain because what you hardcode as its path on your pc
wont be the same on your clients pc when they use your app (sods law).

I often find that its best to use an API call when trying to get
applications to  run documents etc via mapbasic calls..

syntax as follows>>

make a function declaration

Declare Function MYFILEExecute Lib "shell32.dll" Alias "ShellExecuteA"
(ByVal hwnd As Integer,Byval lpOperation As string,byval lpFile As
String,Byval lpParameters As Integer,byval lpDirectory As String,ByVal
nShowCmd As Integer) As Integer
                        
in your application
 
dim x as an integer
dim filetitle as string

now set the variable  filetitle to = the full pathname of the
document/picture/txtfile/ etc  you want to 'launch' 
MAKE SURE that the file has a 'common' file suffix like *.doc, *.txt,
*.jpg...ie (d:\piccys\mypics.jpg)

and enter the following line of code at the appropriate place in your app

x = MYFILEExecute(0,"open", filetitle, 0, "",1)


basically this tells windows to open the file (filetitle) with whatever the
user has set up to run  'files of that type', th ewindows api does all the
hunting around so it doesnt matter if the user has hidden wordpad (or
whatever) in some obscure folder.

if you want to make a bespoke filetype  say *.SMdox  you need to get your
users to set windows to 'associate' *.SMdox with (say) wordpad..

HTH

R


*********************************************************************
This e-mail message, and any files transmitted with it, are 
confidential and intended solely for the use of the addressee.
If this message was not addressed to you, you have received
it in error and any copying, distribution or other use of any
part of it is strictly prohibited. Any views or opinions presented
are solely those of the sender and do not necessarily represent
those of the British Geological Survey. The security of e-mail
communication cannot be guaranteed and the BGS accepts
no liability for claims arising as a result of the use of this medium
to transmit from or to the BGS. The BGS cannot accept any
responsibility for viruses, so please scan all attachments.
http://www.bgs.ac.uk
*********************************************************************

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to