Posts

Showing posts from October, 2007

smallest EXEcutable

This is an interesting page discussing techniques to achieve the smallest EXE possible. http://www.phreedom.org/solar/code/tinype/ More, it says that if you add an UNC path as a name of an imported DLL in an executable, Windows will download and execute that file ! the server needs to be a WebDAV server.

the one and only, the TB_ADDSTRING message !

If you try to use TB_ADDSTRING with the string from the resource then you might had blown your head trying to figure out what the heck is happening, why does it fail: const int iIndex = ::SendMessage( hToolBar, TB_ADDSTRING, hResource, IDS_TBSEARCH); // string id from module's resource iIndex is returned -1 (indicating an error). Now, I looked at my MSDN from disk and then looked at the online version. Nada. But the old friend Mr. Google saved the day (he always does). I got this page: The problem with TB_ADDSTRING or the AddString method that is simply a wrapper to this message is that the first character in the string resource is used as separator and is replaced with a NULL character. So your string resource must be something similar to: "|Button text||" where the pipe character is replaced with '\0'. This is because the string you pass with TB_ADDSTRING message must have a double null terminator. You can also use the TB_ADDSTRINGS messa