Tuesday, September 05, 2006

Annoying Windows Behavior

You cannot create an executable in Visual Studio both inherits its parents standard in/out handles so that it can write to the console if run from a console. If you create a console application, it will inherit from its parent, but it will always create a console window even if not run from a command line.

So, say you would like to create a windows GUI application that you want to be able to pass command line parameters to. This works fine, but imagine you would like to print out a usage message to current console window if parameter is set.
Annoying windows behavior:

You cannot create a shortcut with a relative path to its target. This is annoying in the following situation. Say you want to create a shortcut that sets command arguments for an executable. Then say you would like this directory to be copied to another machine (say from a network drive) and have the shortcut reference the executable in the same directory. There is no way to do this with a shortcut.