Frank -- CommonDialog from AcadX Help

Frank -- CommonDialog from AcadX Help

Anonymous
Not applicable
256 Views
4 Replies
Message 1 of 5

Frank -- CommonDialog from AcadX Help

Anonymous
Not applicable
Hi Frank,

Thank you for all the great help and ideas that you put forth in this forum.
I cannot begin to tell you how much time you have saved me with the posts
that you answer.

I have a question about the commondialog class that you posted on your
website. Is there a way to set the initial directory when using the browse
directory method? I have set the InitialDir property and it does not seem
to change anything. When looking at the Browse method code, I cannot see a
way to do this. Am I missing something? Any ideas would be very much
appreciated.

Thank you very much for your help!
0 Likes
257 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Tim,
The closest I could find to what you're after is the pidlRoot variable that
gets sent to the SHBrowseForFolder function.
#1 problem, pidlRoot is a pointer -- I'm guessing that's why Frank didn't
make this an editable parameter of his code.
#2 problem, even if it was an editable parameter, it looks like you can't
browse ABOVE the pidlRoot directory. I read this to mean that if you start
the user in C:\WORKING, he can't browse back to C:\TEST. This doesn't seem
like what you wanted.

Got this at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/shell/reference/structures/browseinfo.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pla
tform/shell/reference/functions/shbrowseforfolder.asp

Hope this helps...

James
0 Likes
Message 3 of 5

Anonymous
Not applicable
Tim Jendro had this to say
:
> I have a question about the commondialog class that you posted on your
> website. Is there a way to set the initial directory when using the
> browse directory method? I have set the InitialDir property and it
> does not seem to change anything. When looking at the Browse method
> code, I cannot see a way to do this. Am I missing something? Any
> ideas would be very much appreciated.

Everything James says is true. In addition, setting a root in Browse for
Folder requires the use of a callback function. Callbacks are very
tricky in VBA so I decided not to tackle it. I have read an MSDN article
or two on how to use callbacks in VBA so the information is there if you
want to find it.

--
Someone left the grass out in the yard all night.
http://www.acadx.com
0 Likes
Message 4 of 5

Anonymous
Not applicable
Tim,

Maybe this is too simplistic, but I have used the VB functions "ChDrive" and "ChDir" prior to showing the CommonDialog object. This seems to work for my application.

Also, the "CurDir()" function will report what the current directory is. This can be helpful to know before changing it to something else (i.e. you might want to change it back!).

Hope this helps.
0 Likes
Message 5 of 5

Anonymous
Not applicable
Thank you to all who helped me with this issue. I have an active x dll that
i use to browse for a directory, although I really like the version that
Frank had posted. I will do some searching on the MSDN website and see what
I can find for using this version, otherwise I can always go back to the
other version that I have been using.

Thank you all again for your help and suggestions.

"Tim Jendro" wrote in message
news:49E3C9F74EAF3A1AB7FA22E6E2645A54@in.WebX.maYIadrTaRb...
> Hi Frank,
>
> Thank you for all the great help and ideas that you put forth in this
forum.
> I cannot begin to tell you how much time you have saved me with the posts
> that you answer.
>
> I have a question about the commondialog class that you posted on your
> website. Is there a way to set the initial directory when using the
browse
> directory method? I have set the InitialDir property and it does not seem
> to change anything. When looking at the Browse method code, I cannot see
a
> way to do this. Am I missing something? Any ideas would be very much
> appreciated.
>
> Thank you very much for your help!
>
>
0 Likes