Re: Using GetSaveFileName API with VB6

Tech-Archive recommends: Fix windows errors by optimizing your registry



"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.

--
Regards,

Rick Raisley
heavymetal-A-T-bellsouth-D-O-T-net


.


Quantcast