Whenever I set up a new machine (which happens a lot as WinXP and .NET go
through their beta & RC cycles), I always need to manually set up the
completion character (to TAB, of course) in the Registry.
Shawn VanNess
posted a .rgs file that would set this up without the lengthy search
through the Registry. Inspired by Shawn, here’s my own
completionChar.reg that doesn’t require a program to parse .rgs files
(which doesn’t come with Windows).
BTW, if you don’t know about the command shell’s Completion Character, stop
right now, run the completionChar.reg file,
start up a WinNT/Win2K/WinXP command shell, type “cd c:\p[TAB]” and watch while
the shell expands it to “cd C:\Program Files" for you. If you have other
directories that start with “c:\p”, continue to hit [TAB] to cycle through
them. This works for any directory or file name and it boosts my productivity
by about 100% on the command line. I can’t live without it!
Wow. I’m impressed as all get out. Hugh Brown
has reverse-engineered Gen<X> as one of the tests of his
NullScript implementation. I wish I would have had this when I started
Gen<X> a couple of years ago. It would’ve saved me figuring out how ASP
did it.
My thinking along these lines years ago led me to go the opposite way, i.e. I
built a front-end ASP parser that generated script for VBS. I called it
TextBox (which, as a Win32 programmer, I should’ve realized was a
terrible name…).
I got tired of not having getopt under Win32 and the best version to port
doesn’t handle slashes (as per the Windows standard) or @files for arguments
and it requires you to give away the source for every app that uses it, so,
inspired by my friend Josh Gray, I built my
own. It supports typed flags and params, @file support and building
full usages on the fly.
I’ve seen lots of interest lately in expando objects, e.g. objects that can add
methods and properties on the fly. Joe Graf wrote
a piece on IDispatchEx in MIND that was pretty interesting.
My own implementation of IDispatchEx is available here. It supports
expando objects that have no static properties or methods as well as those that
do. Check out the DispExTest.js for a demonstration, dispeximpl.h,
dynamemlist.h and dynamemlist.cpp for the implementation and MyExpando.h for
the usage.
WTL is, spiritually at least, what the MFC team would’ve come up with had they
started with the C++ language as it is today. It’s an extension to ATL
and
available as a download from Microsoft.
WTL is pretty much completely undocumented, but you can read
about it in a 2-part series by
Chris Sells, Dharma Shukla and
Nenad Stefanovic (chief engineer on
WTL at Microsoft):
CComBool is a class to prevent the misuse of the VARIANT_BOOL type.
VARIANT_BOOL is a problem because its legal values are -1 and 0 instead of 1
and 0, making converting back and forth between bool, BOOL and VARIANT_BOOL
problematic. CComBool supports the constructors and operators needed to convert
between the three C++ Windows Boolean types. It also supports operator& and
CopyTo for common COM client and server usage. CComBool is
available here.