Source Code
The source code presented here is in a format that you can use immediately. Either the source file for the function or class is displayed or a ZIP file with the source code is available. Either way you will not have to edit the source code to remove the usual < and > HTML tags.
Some of the source code may require you to have additional debug facilities such as extra ASSERTs (which can just be edited out if you don't want them), you can download these from DebugHlp
The code in the links below is free to use with the following minor restrictions:
- Please leave the header comment intact.
- Do not distribute any code found here as part of a library.
- Do not use code found here on your own web site.
- Do not claim code found here as you own, give credit where it is due.
Other than that you can use the source code in your applications as you see fit.
The obvious disclaimer: The authors of the code cannot guarantee that the code works nor can they be held responsible for any loss or damage as a result of it's use.
Suggestions, Improvements or Bugs
Email any suggestions, improvements or bug reports to me.Coding conventions
I'm lazy, I admit it, and I think all developers are essentially lazy. I like my code to be as easy to read as possible, I like whitespace and I enjoy the use of comments. Mostly I prefer my code to look the same. Here is a link to my guidelines. Rememeber that's all they are, not rules but preferences.
Coding Guidelines and convention
String
String related functions and classes.- strrtrim
- Trim the trailing white space from a string
- strltrim
- Trim the leading white space from a string
- strrepc
- Replace all occurrences of a character in a string
- stristr
- Case insensitive version of strstr, find a string within a string
- strright
- Get the right n characters of a string
- strremove
- Removes all occurrences of a string from another
- striremove
- Case insensitive version of strremove
Window
Functions and classes related to using windows.- SetWindowIcon
- Easy way to set both large and well formed small icons for a window.
- PtInWindow
- Determine if a point is within a window.
- CWindowText
- Simple class that wraps up the GetWindowTextLength/GetWindowText functions
- IsWindowVisibleEx
- Determine the correct visibility of a window.
File/Directory
Functions and classes related to using files and directories- RemoveFilename
- Remove the filename element from a fully qualified file path.
- GetModulePath
- Given a HINSTANCE it will retrieve the path without the filename.
- GetProgramFilesDirectory
- Function to retrieve from the system the path to the program files directory
- CreateDirectoryPath
- Creates an entire directory path, including sub-directories
- WriteStringToFile
- Write a C style string to a file
- CSplitPath
- Wrapper for the _splitpath and _makepath functions
- GetFileTimes
- Utility function to get the three times associated with a file.
- SetFileTimes
- Utility function to set the three times associated with a file.
- class CRandomFile
- Store, retrieve, delete and recycle random sized data in a file.
Miscellaneous
Functions and classes that currently have no real home.- NormalizeRect
- Function to normalize the coordinates of a rectangle
- ResourceLoader
- Class to make it a little easier to load any type of resource.
- CopyBitmapToClipboard
- Copy a HBITMAP to the clipboard
- CLoadLibrary
- Exception safe wrapper class for Load/FreeLibrary APIs
- RealGetDiskFreeSpace
- Get the disk free space regardless of Win95 release
- DrawBitmap
- Draw a HBITMAP onto a DC
- DrawBitmapStretched
- Stretch Draw a HBITMAP onto a DC
- DrawTiledBitmap
- Tile a HBITMAP onto a DC
- CDynamicRas
- Wrapper class for dynamically loading the RAS DLL
- GetCurrentColorDepth
- Get the current color depth
Internet
Classes and function that are somehow related to the internet- Class HTTPParametersABC
- Abstract base class that parses the parameters passed into a CGI or ISAPI EXE/DLL.