Long file names and CommonDialog 
Author Message
 Long file names and CommonDialog

Even if VB4 and Win95 supports long file names, the extension can
still only be three characters long. The whole filename can be 255
characters long.

Peter Larsson



Wed, 16 Dec 1998 03:00:00 GMT  
 Long file names and CommonDialog

=Do the Open and Save CommonDialogs work properly with LFNs?
=
=I can't get it to return a filename with .htm as the extension unless
I
=explicitly type the .html in.
=
Here was my solution; it seems to work well. Found it in the VB Help
when I looked at the Flags property.
I put this in the MDIForm Load Event, which pretty much sets it for
what I use it for.

    With CommonDialog1
        .Flags = cdlOFNOverwritePrompt+cdlOFNExplorer+cdlOFNLongNames
        ' The above sets Overwrite warning, Explorer type dialog and
        ' Long File Name support for the Common Dialog Control
        .DefaultExt = ".html"
        'The above line sets the default extention of the dialog
        .Filter = "Rich Text Format files (*.RTF)|*.RTF|_
        Text Files(*.txt)|*.TXT|Hyper Text Markup Language_
        (*.HTML)|*.HTML|Hyper Text Markup (*.HTM)|*.HTM"
        .FilterIndex = 3
        'The above line sets the default filter to HTML extentions.
    End With

Finally, one I knew!

-----------------------------------------
Michael A. Long

webmaster: http://www.athenon.com/mlong/dshome.htm

Of all the things I've lost, my mind is what I miss the most.



Thu, 17 Dec 1998 03:00:00 GMT  
 Long file names and CommonDialog

Quote:



> =Do the Open and Save CommonDialogs work properly with LFNs?
> =
> =I can't get it to return a filename with .htm as the extension unless
> I
> =explicitly type the .html in.
> =
> Here was my solution; it seems to work well. Found it in the VB Help
> when I looked at the Flags property.
> I put this in the MDIForm Load Event, which pretty much sets it for
> what I use it for.

>     With CommonDialog1
>         .Flags = cdlOFNOverwritePrompt+cdlOFNExplorer+cdlOFNLongNames
>         ' The above sets Overwrite warning, Explorer type dialog and
>         ' Long File Name support for the Common Dialog Control
>         .DefaultExt = ".html"
>         'The above line sets the default extention of the dialog
>         .Filter = "Rich Text Format files (*.RTF)|*.RTF|_
>         Text Files(*.txt)|*.TXT|Hyper Text Markup Language_
>         (*.HTML)|*.HTML|Hyper Text Markup (*.HTM)|*.HTM"
>         .FilterIndex = 3
>         'The above line sets the default filter to HTML extentions.
>     End With

> Finally, one I knew!

That's great, but how do you get the same functionality of long file
names on the Dir1 and File1 custom controls?

--
B. Dean Fairchild, Miami, FL, USA (305) 242-0004



Thu, 17 Dec 1998 03:00:00 GMT  
 Long file names and CommonDialog



alleged

=>=Do the Open and Save CommonDialogs work properly with LFNs?
=>=
=>=I can't get it to return a filename with .htm as the extension
unless
=>I
=>=explicitly type the .html in.
=

=I had a look at (but not success with) flags
As far as I can tell, the VB3 way was to OR the flags. In VB4 you ADD
them.
=
=>    With CommonDialog1
=     ^^^^
=Dammit, I wish I'd remembered that about a week ago when I had to
type
=lots of CommonDialog1.s in before each property.
=
Yep, I did the same and then saw an example in the help file.

=>        .Flags =
cdlOFNOverwritePrompt+cdlOFNExplorer+cdlOFNLongNames
=                                        ^^^^^^^^^^^^^^
=                        I can't really tell what difference this
makes
For my purposes ( an HTML editor) I wanted to make sure that the users
were warned they were going to overwrite if they used save as.

=>        .Filter = "Rich Text Format files (*.RTF)|*.RTF|_
=>   Text Files(*.txt)|*.TXT|Hyper Text Markup Language_
=>   (*.HTML)|*.HTML|Hyper Text Markup (*.HTM)|*.HTM"

oops. looked in the help file. You can put: .filter = "Hyper Text
Markup Language (*.HTML;*.HTM)|*.html;*.htm"
They will then be in the same filter.

-----------------------------------------
Michael A. Long

webmaster: http://www.athenon.com/mlong/dshome.htm

Of all the things I've lost, my mind is what I miss the most.



Sat, 26 Dec 1998 03:00:00 GMT  
 Long file names and CommonDialog



alleged

=>=Do the Open and Save CommonDialogs work properly with LFNs?
=>=
=>=I can't get it to return a filename with .htm as the extension
unless
=>I
=>=explicitly type the .html in.
=

=I had a look at (but not success with) flags
As far as I can tell, the VB3 way was to OR the flags. In VB4 you ADD
them.
=
=>    With CommonDialog1
=     ^^^^
=Dammit, I wish I'd remembered that about a week ago when I had to
type
=lots of CommonDialog1.s in before each property.
=
Yep, I did the same and then saw an example in the help file.

=>        .Flags =
cdlOFNOverwritePrompt+cdlOFNExplorer+cdlOFNLongNames
=                                        ^^^^^^^^^^^^^^
=                        I can't really tell what difference this
makes
For my purposes ( an HTML editor) I wanted to make sure that the users
were warned they were going to overwrite if they used save as.

=>        .Filter = "Rich Text Format files (*.RTF)|*.RTF|_
=>   Text Files(*.txt)|*.TXT|Hyper Text Markup Language_
=>   (*.HTML)|*.HTML|Hyper Text Markup (*.HTM)|*.HTM"

oops. looked in the help file. You can put: .filter = "Hyper Text
Markup Language (*.HTML;*.HTM)|*.html;*.htm"
They will then be in the same filter.

-----------------------------------------
Michael A. Long

webmaster: http://www.athenon.com/mlong/dshome.htm

Of all the things I've lost, my mind is what I miss the most.



Sat, 26 Dec 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Can't Get full File name for Long file names

2. Get long file name from short file name

3. 8.3 file name to Long file name

4. Long File Names and Short File Names

5. Get Short File Name from Long File Name?

6. Long file names to 8.3 File names convertion

7. Long file names to short file name

8. Getting short file name from long file name:

9. Converting Long File Names to Short File Names

10. long file names to short file name

11. How to convert long file names to short file names

12. Api function to convert Long File Names To Short Dos File Names

 

 
Powered by phpBB® Forum Software