2006/04/05

The Da Vinci Code

I have bought this book for more than one year. But haven't got a time to read until recently.

As a mystery book, this is a quite "honest" one. Some mystery books will never tell you all the clues until the end of the books. This one is different, the author is pretty honest of sharing all the information to readers. Knowledgeable reader can enjoy solving these puzzles with a little effort. The information needed to solve the puzzles are somehow redundant, so reader can even verify their solution to the puzzles.

As a religious book, I have zero religious knowledge. So, what I can say is that this is a pretty good book to the introduction of the Holy Grail.

However, the final part of the book is disappointing. And I think it is a little bit inconsistency to the rest part of the book. Maybe, the fact of the real world restricts degree of the writing freedom.

2006/02/16

File extension association under windows

The windows registry is always a mistery to me. Microsoft made everything as complicated as possible, you can see how complicated it is here if you are not in a hurry.

Basically, InstallShield has [Registry Entries] function in the [Resources] tag.
1) Add a new entry in the [Registry Entries], normally the name of the entry will be "Registry Set-1".
2) Under [HKEY_CLASSES_ROOT], add a new key.
3) Type the key name as .ext\shell\open\command, where the .ext is the name of your extension.
4) Automatically, under this key, there will be a String Value with default empty value, modify the string value to <targetdir>\YourApp.exe, if you'd like the application to open that file, then add a %1 as a command line parameter. So basically, you would type:
<targetdir>\YourApp.exe %1

However, the story is not over yet. If the system is not rebooted, then this information is not updated to the windows system. So in the [Scripts], you need to add the following:
#define SHCNE_ASSOCCHANGED 0x08000000
#define SHCNF_IDLIST 0x0000

prototype Shell32.SHChangeNotify(LONG, LONG, POINTER, POINTER);

// ...and later...

SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);

Well, it's not guaranteed to work. For example, the installshield version coming with VC++ will not accept this dll function prototype, only professional version will work.