Archive for Prof-UIS

My problem with PSH_WIZARD97

I just resolved a programming problem that I was struggling with for the last day and though maybe it could help to somebody else so here it is.

I used CExtResizablePropertySheet from Prof-UIS and everything worked fine. Then suddenly I realized it stopped showing the watermark area altogether with the page title and subtitle. I could swear it worked in my last release. So, I installed it back and yes, it worked. So, it had to be something I changed very recently.

I found out that I changed the WINVER and _WIN32_IE flags to 0×0500, because I wanted to show balloons from the systray. So, this was one possible change, but I could not go back, I needed the balloons. I started debugging the code and I realized that the code execution skips the part in the ProfUIS library where the watermark should be drawn. The check is something like this:

if( (m_psh.dwFlags&(PSH_WIZARD97)) == (PSH_WIZARD97) )

Hm, the ‘if’ condition was never met. Strange, I was certain I set that flag. And yes, I was setting it. But, then I lookup the definition for that flag, and what a surprise, that flag had a different value for Win2000 and up.

#if (_WIN32_IE < 0x0500)
#define PSH_WIZARD97 0x00002000
#else
#define PSH_WIZARD97 0x01000000
#endif

I had compiled the ProfUIS library without 0×0500 for WINVER and _WIN32_IE defined, and that’s why the flags where different. When I compiled my main program, the new value (Win2000 and above) was used, but ProfUIS library was still using the old value. Then I realize, I should recompile the ProfUIS with these flags defined.

Great, now it is same as before.

Comments