Re: Using GetSaveFileName API with VB6
- From: MM <kylix_is@xxxxxxxxxxx>
- Date: Thu, 26 Mar 2009 17:13:45 +0000
On Thu, 26 Mar 2009 07:59:30 -0400, "Rick Raisley"
<heavymetal-A-T-bellsouth-D-O-Tnet> wrote:
"MM" <kylix_is@xxxxxxxxxxx> wrote in message
news:60fms49t2sc8dko1livpvlmokmd8dodbqc@xxxxxxxxxx
On Wed, 25 Mar 2009 18:10:03 -0700, "Karl E. Peterson" <karl@xxxxxxxx>
wrote:
MM wrote:
What is *actually* returned in the last example above is
gfh654.xyz.lay, that is, despite my typing an extension that is
different from the one given in sDefFileExt, Windows is appending
sDefFileExt to my extension!
Yeah, that's the way Windows works. Try opening a new document in Word,
and Save as
"Doc1.xyz" -- see what you get. :-(
******************************************************************************
This behaviour by Windows makes no sense and is contrary to the
explanatory notes for GetSaveFileName
******************************************************************************
Maybe it'll help to realize it was written when *every* file was an 8.3
critter, and
that dots weren't valid filename characters?
Is there a way of doing what I want with the dialog flags? Or do I
have to code around it? Or am I completely missing something?
I think you have to code around it. And who's to say, really, that the
user doesn't
want a file with two dots in it?
Fine, but why do the docs say the def extension will be appended IF
the user didn't type one? Are the docs wrong or is this a bug?
I consider this proper operation. Normally, to save any document, you select
a FILE TYPE, which usually defines an extension. Windows, then, is saying
that if you do not add the proper extension, for that file type, it will add
it for you. Any other extension can easily, and is, interpreted as part of
the file name. Like when saving an Excel XLS spread***:
Save as MyFile.xls > MyFile.xls
Save as MyFile > MyFile.xls
Save as My.Document > My.Document.xls
Save as My.Doc > My.Doc.xls
I consider these all proper, and expected, operation.
If you don't use the proper extension for the file type being saved, the
program (or maybe it's Windows, don't know) adds the standard extension for
you.
Fine, but that's not what the docs say! From the horse's mouth (MSDN):
"GetOpenFileName and GetSaveFileName append this extension to the file
name if the user fails to type an extension."
If I type MyFile.xyz I don't expect Windows to add the def extension,
e.g. MyFile.xyz.lay, but it is. This is plain wrong. The OFN member
is, after all, called s....DEF.....FileExt!! That is, it's intended as
the DEFault for when nothing was specified.
MM
.
- References:
- Using GetSaveFileName API with VB6
- From: MM
- Re: Using GetSaveFileName API with VB6
- From: Karl E. Peterson
- Re: Using GetSaveFileName API with VB6
- From: MM
- Re: Using GetSaveFileName API with VB6
- From: Rick Raisley
- Using GetSaveFileName API with VB6
- Prev by Date: Re: Beep Again
- Next by Date: Re: Using GetSaveFileName API with VB6
- Previous by thread: Re: Using GetSaveFileName API with VB6
- Next by thread: Re: Using GetSaveFileName API with VB6
- Index(es):