|Submitted on: 11/7/2003 3:45:58 PM |
By 5 Users
Users have accessed this code 649 times.
(About the author)
| Handling File Paths. The VB programmer should try to use the API wherever possible. It is usually faster and more memory efficient than most VB methods. We should also make use of .RES files rather than hard coding to reduce the amount of memory consumed by our applications. This little demo attempts to illustrate these concepts in the simplest possible way.|
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.
Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
3)Scan the source code with Minnow's Project Scanner
If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com
Terms of Agreement:
By using this code, you agree to the following terms...
1) You may use
this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
Other 60 submission(s) by this author
|Report Bad Submission|
See Voting Log |
|Other User Comments|
|11/7/2003 7:57:52 PM:|
I'm luckily to see your code again.
Thanks to you for your sharing code..!!
|11/8/2003 7:58:33 AM:Norm Cook|
Thanks for sharing. However, (1) RES
files conserve no memory since they are
compiled into the exe, the same as hard
coded resources. Plus there's the
overhead of the LoadResData/String
calls. (2) The PathOnly function in
your screen shot can be replaced with
PathOnly = Left$(mPath, InStrRev(mPath,
"\") - 1), which, on my box is about 10
times faster & saves resources.
|11/8/2003 9:01:55 AM:MrBobo|
Norm - No and Yes...
No - Res files DO
conserve memory usage,"Performance and
capacity are increased because strings,
bitmaps, icons, and data can be loaded
on demand from the resource file,
instead of all being loaded at once
when a form or a module is loaded."
MSDN - and experience.
Yes - there
is no "PathOnly" function via the API -
only a FileOnly (PathStripPath) so in
order to demonstrate API usage I used
the FileOnly function with a bit of
|11/8/2003 9:10:37 AM:MrBobo|
Normally I would not use
the API for Pathonly but instead parse
The parsing method you
mention however needs some tweaking -
"C:\text" for example would return "C:"
instead of the slightly more preferable
"C:\". But your point is taken none the
less. Thanks for the feedback.
|11/8/2003 9:16:08 AM:MrBobo|
As to the speed of
functionality - normally these sort of
routines are called once only within a
Sub/Function and not repeatedly so any
lag is insignificant. If they exist
within a loop you should not make calls
to other functions but include the code
within the loop itself.
|11/9/2003 11:23:57 PM:Roger Gilchrist|
5 * just 'cause the demo form is so
well laid out
|11/10/2003 6:46:53 AM:|
Simply : EXCELENT
Clear, simply and
Five Stars for
you. Thanks for sharing.
| Add Your Feedback! |
|Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name. |
NOTICE: The author of this code has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular code, please click here.