From: Stuart McCall on
"The Frog" <mr.frog.to.you(a)googlemail.com> wrote in message
news:cb5bc6a8-e832-41fa-8c1a-a3dafbad865f(a)g4g2000yqa.googlegroups.com...
> Thanks to both of you for your knowledge sharing. I deeply appreciate
> it. I was growing increasingly concerned that I would need to create
> some 'super parser' to be able to deal with the issue having not
> realised how convoluted the problem really is. These are both simple
> and direct tools I can use. Thankyou
>
> Cheers
>
> The Frog

Just one more piece of knowledge I think will be useful for you is this:
You're probably concerned with users typing in badly formed paths, right? If
so then you ought to present them with the windows open/save dialog as this
will handle the entire issue for you. The dialog will not return a badly
formed path. Plus users can choose to navigate via the folder list or type
the path themselves. Find code to implement the dialog here:

http://www.smccall.demon.co.uk/MiscApi.htm#FileOpen

HTH


From: The Frog on
Stuart,

Once again thankyou. In my app that I am building I am using this
approach already. The problem 'may' come when one of the clases I have
built is used by another person without following this approach. I
wanted to control for errors creeping into the class and handle them
gracefully (raise an event stating path/file is rubbish so go do it
again :-) The code you posted above has allowed me to solve this for
the largest part. I think going beyond what you have posted is
probably not worth the effort - after all I do have documentation with
the class as well.

Thanks once again.

The Frog
From: Stuart McCall on
> Thanks once again.
>
> The Frog

You're welcome.


From: David W. Fenton on
"Krzysztof Naworyta" <k.naworyta(a)datacomp.com.pl> wrote in
news:hod0ir$ivo$1(a)news.onet.pl:

> You can use very usefull dll: shlwapi

The File System Object is a useful wrapper around all of these
functions, no?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
From: The Frog on
Hi David,

I use FSO for achieving my file / folder selection. And I agree that
it is a nice wrapper. I was also interesting to play with the API
directly - a little more complex but produces essentially the same
result. I am using several classes that work together to achieve a
goal, although some of them can work without the others, hence my
issue above. I am comfortable that this is now controlled for in my
application and that if the class in question is used separately by
another person there are reasonable safeguards against crashing and
erroneous use.

The Frog