- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a QuickWin application that I would like to be able to start up by double-clicking on an input data file
having an extension (like .asc) which has been associated with my application. How would I implement this
so that the application can get the file name and working directory?
Also, how would I be able to debug the code in the Debugger once I have made this change? Double-clicking
just starts the application without the debugger environment.
Jim Breeding
having an extension (like .asc) which has been associated with my application. How would I implement this
so that the application can get the file name and working directory?
Also, how would I be able to debug the code in the Debugger once I have made this change? Double-clicking
just starts the application without the debugger environment.
Jim Breeding
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried using GETARG and it sort of works but there is a problem caused by some subdirectories having spaces in their names (such as "Program Files"). GETARG seems to parse the "command" using spaces as the delimiter between commands so it breaks the input file path name into several strings. Is there a simple way to get the file name into one string without writing a routine to append the strings together and guess where the spaces go?
I still don't know how to debug a program activated with this feature.
Jim Breeding
I still don't know how to debug a program activated with this feature.
Jim Breeding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
GETARG is just doing what Windows would do for the command line token separators.
I don't know of a way to debug a program started this way, but you can, in Developer Studio, select Project..Options..Debug and specify command line parameters. If a parameter has embedded spaces, surround it in quotes.
Steve
I don't know of a way to debug a program started this way, but you can, in Developer Studio, select Project..Options..Debug and specify command line parameters. If a parameter has embedded spaces, surround it in quotes.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, NARGS() and GETARG work fine for me even when
file paths have spaces in them (I am using WINDOWS 2000). You can use Explorer..
tools..folder options..filetypes tab to associate your application with files of a particular extension and get
it to fire up with a double-click on file name as if you
started the application from a command line with the filename as argument. You can even get drag-and-drop capability using NARGS and GETARG, if you create a desk-top shortcut icon and drop a filename onto it.
Just make sure that you assign a large enough character buffer [ e.g. CHARACTER($MAXPATH) ] in your routine that calls GETARG to take the filename and full path.
file paths have spaces in them (I am using WINDOWS 2000). You can use Explorer..
tools..folder options..filetypes tab to associate your application with files of a particular extension and get
it to fire up with a double-click on file name as if you
started the application from a command line with the filename as argument. You can even get drag-and-drop capability using NARGS and GETARG, if you create a desk-top shortcut icon and drop a filename onto it.
Just make sure that you assign a large enough character buffer [ e.g. CHARACTER($MAXPATH) ] in your routine that calls GETARG to take the filename and full path.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using Windows NT. I can write a kluge to append the text segments together to get a proper pathname. Just seems a shame to have to do that.
Jim Breeding
Jim Breeding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess it's a bug in NT's extension registration utility. In Explorer, Tools/Options/File Types, the command for starting the application should be
not, as I suspect,
Jugoslav
"C:SomewhereMyApp.exe" "%1"
not, as I suspect,
"C:SomewhereMyApp.exe" %1
Jugoslav
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page