-> Back to the problem...
->
-> I know that if I want to *FEED* a long file name with embedded
-> spaces to another program I should enclose it in quotes - for
-> example, at a DOS prompt I can type CD "Program Files" to change to
-> that dir.
-> What I'm trying to discover is how to accept a long file name on the
-> command line of MY program:
->
-> I've written a 16-bit text editor. When it's the associated program
-> for a .TXT file, when I double click readme.txt in Explorer,
-> readme.txt gets loaded into my editor, no sweat.
->
-> However, when I port that editor into 32-bit and associate .TXT
-> files to the new 32-bit version, when I double click "Read Me
-> Now.txt" in explorer, I get error "File not found: Read". My program
-> is parsing paramstr(1) ('Read') as unrelated to paramstr(2) ('Me')
-> etc.
-> It's since ocured to me to whip together a prog that will display to
-> me the entire command line, so I can see exactly what Win95 is
-> sending. Perhaps then I'll figure it out.
Ok, now I see the problem...The may be a more elegant way to accomplish
what you want through a method I haven't found such as a Delphi fucntion
or API call, however, a quick and dirty way to do this would be to grab
everything on the command line, parse it, and put together your
path/filename. I don't think you will need the quotes inside of Delphi
2 or 3. This should not take more than a few lines of code.
->
-> I guess what I'm looking for is someone to hand me code on a silver
-> platter. I hate the 'original thinking' part of programming :-)
->
Heheheh...And I won't hand it to you here .
Just setup a loop and grab each param off the command line and build
your string (preserving the spaces as you go) with the filename. It
looks the spaces are what's getting you into to trouble here. I would
assume that if you tried to open a long filename with no
spaces, it works i.e. MyReadMeFile.TXT.
Hope this helps.
Steve
--- HyperMail! v1.22
---------------
* Origin: Omni - (916) 388-0905, longest running Sac BBS (1:203/3333)
|