Archive for March, 2010

Search for a file

The _searchenv routine searches for the target file in the specified domain. The varname variable can be any environment or user-defined variable that specifies a list of directory paths, such as PATH, LIB, and INCLUDE.

The routine searches first for the file in the current working directory. If it does not find the file, it looks next through the directories specified by the environment variable. If the target file is in one of those directories, the newly created path is copied into pathname. If the filename file is not found, pathname contains an empty null-terminated string.



Gone are the days of my past,
Gone are the days of my childhood innocence,
Gone are the days of my first and last.
Gone are the days of being carefree,
Gone are the days of my elation,
Gone are the days of my glee.
Gone are the days of my fear.
Gone are the days of savor.
Gone are the days I spent here.

Gone, Gone, Gone are the days
And I fear
It’s becoming more clear!

Shell Path Handling functions.. 🙂

On my career start, I worked a lot with windows folders,files, creating folder/files,  copying file from one location to another, rename folders/files, verify the given name is a file or folder like that.

For doing such things, at that time, I regularly used the basic file handling functions in MFC or Win32 and most of the processing are done with the very familiar CString class.

By ‘processing’ means adding or removing the back slash character, adding the filename at the end of a path name, adding a file extension etc 🙂

Now i’m used with some Shell Path functions..

here are some quite interesting shell functions and their description from MSDS

  1. PathAddBackslash- Adds a backslash to the end of a string to create the correct syntax for a path. If the source path already has a trailing backslash, no backslash will be added.
  2. PathCompactPath-Truncates a file path to fit within a given pixel width by replacing path components with ellipses.
  3. PathGetDriveNumber-Searches a path for a drive letter within the range of ‘A’ to ‘Z’ and returns the corresponding drive number.
  4. PathRemoveExtension-Removes the file extension from a path, if one is present

and a lot more.. 🙂

for VCTips++


Contentment is not the fulfillment of what you want, but the realization of how much you already have.