BrowseForFolder questions

C

ctyrrell

I have recently enhanced my BrowseForFolder approach to include the
'NewDialogStyle' thus giving me the ability to show the 'Create New
Folder button'. Essentially, I am very pleased with the results but
have two areas of concern, which I will detail further on:
1. Shell version handling
2. OK box not graying out.

My implementation is based upon the ShellBrowse class module and
basShellBrowse module from the Access 2000 Developer's Handbook,
Volume I by Getz, Litwin, and Gilbert. (Sybex). My recent enhancements
involve implementing more properties for the newer BIFS. This
technique uses SHBrowseForFolder as defined by

Private Declare Function SHBrowseForFolder Lib "shell32.dll" _
(ByRef bi As BROWSEINFO) As Long

1. Shell version handling.
------------------------------------
Several of the features I am using require a certain version of
Shell32.dll. What happens if I use the feature, by setting the
particular BIF and the Shell32.dll on the user's machine is an older
version. Does it just ignore the BIF, or does it trigger an error, or
God forbid, does it crash? Should I include code to check for the
Shell.dll version and then write more code if it is not the right
version? Can the user just get a newer version of Shell32.dll and
replace the one they have? Or does their Shell32.dll have to be
compatible with other components. If it is as simple as replacing the
Shell32.dll, can I just give them a copy of mine? Or is this a
licensing issue. I really like the 'NewDialogStyle' - the stretchiness
etc is very nice, but other than the 'Make New Folder' button it is
not critical to functionality. But if I cannot count on the 'Make New
Folder' button working then I need to provide another way for the
user of my product to be able to tell me they want to create a new
folder and I (my software, that is) can create it for them.

2. OK box not graying out.
------------------------------------
No matter what BIFs I set, I have not yet been able to make the OK
button gray out. So maybe my understanding of the documentation is
wrong. For example. if I have set the BIF_BROWSEFORCOMPUTER value,
then my expectation is that if I select an actual file path such as 'C:
\Dir\Dir2\Dir3' that the OK button would gray out and I should not be
able to return this path. However,it does not gray out I can.

Similarly, I thought that if I set BIF_RETURNONLYFSDIRS, that if I
select 'My Computer' then it would be grayed out. But it is not and
'<My Computer>' is returned. If this is how it is supposed to be then
I guess I can add code to check for '<' at the beginning of the
returned path, but if I am just doing something wrong, then I'd prefer
to fix how I am doing it. Has anyone else had problems with the
graying out not happening. Am I supposed to set another BIF in
conjunction?

Many thanks for any insights or suggestions.

Christine
 
C

ctyrrell

I discovered that when I m not using the NewDialogStyle the OK button
does gray out the way I thought it should. It is only when I a using
the New Style that it does not.

In looking further I saw that calling OleInitialize was required for
the NewDialogStyle, so I added

Private Declare Function OleInitialize Lib "ole32.dll" _
(ByVal Nullptr As Long) As Long

to the top of my clsShellBrowse class module and added

OleInitialize 0

at the start of the BrowseForFolder routine in that same module.

But it didn't make any difference.
I really do hope some kind soul will jump in to help. Please help if
you can.

Thanks,
Christine
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top