Essentially, you write a new task like this:
<define name="echo3">
<echo message="${this.message}"/>
<echo message="${this.message}"/>
<echo message="${this.message}"/>
</define>
...and then you call it like this:
<echo3 message="Hello World"/>
Any parameter passed to the defined task is available as this.foo inside the defined task. I've found it useful when you don't want to write a task in C#, perhaps because all you're doing is calling a bunch of other NAnt tasks.
I just started using TeamCity Professional Edition for some personal projects (and we're evaluating the Enterprise edition for use at work).
ReSharper allows you to define "Live Templates". They're like Visual Studio snippets, but much more useful. So that I don't lose mine, I'm going to stash them here.
Unless specified otherwise, all source code published on the differentpla.net website is available under the following license terms: Do what you want with it, but don't claim you wrote it, and it's not my fault if it doesn't work.
If you want to read a file and bypass security (e.g., if you're writing a backup program), it's not enough to simply enable the SE_BACKUP_NAME privilege, you have to also pass FILE_FLAG_BACKUP_SEMANTICS to CreateFile.
Fortunately, you don't have to do this for FindFirstFile. Enabling the privilege is enough.
I've got a dialog box with a SysLink (WC_SYSLINK) control on it. When the user clicks on the link, it should open our website in the user's default browser. In my test app, it works. In the production app, it doesn't.
...because every time I search for a given HRESULT, all I get is yet another frigging VB website regurgitating the contents of WinError.h
I'm doing a bunch of SQL hacking at the moment, and I've decided to use SQL Query Analyzer as a good template for how not to write a text editor.
Note that this only applies to SQL Query Analyzer in SQL 2000. SQL Management Studio in SQL 2005 has its own set of suckage. I'm sure I'll rant about that when I've used it more.
I just spent the best part of a morning chasing this one down, so I thought I'd share it with you:
If you try calling CListCtrl::InsertItem (or LVM_INSERTITEM), using LPSTR_TEXTCALLBACK, you can't use either of the LVS_SORTASCENDING or LVS_SORTDESCENDING styles for the list view.
Question: Everyone "knows" that you should write a decimal to Roman number converter using a table. What happens if you try it test-first?