Right. Finally I have worked out what has been happening over the last couple of days. Fully two days, I would way, working out why, suddenly, with no code changes I could account for to cause it, the notepad window suddenly showed garbage.
Just to recap:
- The notepad window has worked fine for years.
- I recently made various changes to other parts of the code - some of which were just moving code around into different files.
- Some improvements were also made, but basically the CTextView was not touched at all.
- Suddenly, the notepad just showed garbage.
- Reverting back to previous commits didn't fix the problem.
- It seemed to be just something in version 4.62, but no code change seemed to be possibly responsible.
- With the assistance of Worstje, and adding a substantial amount of extra code the problem went away.
- There were then complaints that this should be conditionally added because recent compilers "weren't broken" like mine was.
- There have been hints that perhaps I should spend $1000+ to get a "better" compiler.
But none of this explains why. Why did it suddenly start happening? I deleted all temporary files, did a rebuild all, everything I could think of. Then there was a small clue, doing a debug start up:
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winmm.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comdlg32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll',
no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\shell32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winspool.drv', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\oledlg.dll', no matching symbolic information found.
What the heck is C:\WINDOWS\WinSxS? A quick Google reveals it is part of Microsoft's "compatibility" system. But I didn't remember seeing that before.
Aha! There was one change recently - but not to the source, which is why reverting the source didn't affect anything. Here it is ...
Worstje said:
I created a theming branch on github, and have already fixed the bug regarding the notorious "tip of the day" dialog.
...
May I request testing and, assuming there are no issues, to have support for visual styles turned on by default?
The problem is caused by having the file MUSHclient.exe.manifest in the MUSHclient directory. No wonder reverting the source didn't fix it, because that file wasn't reverted (ie. deleted).
To be fair to Worstje he didn't expect this to happen. Neither did I. And had the problem surfaced the moment after putting the manifest file there I would have twigged. But it was like hours later, or the next day, after even more source changes, that I thought to open the internal notepad. One of the reasons for that is, that I use Crimson Editor most of the time, and when I hit "edit" to edit a plugin, it just goes to Crimson Editor.
What the new themes did is bring in a new comctl32.dll which handled the edit controls differently. Pretty subtle huh? Pretty annoying too.
It's annoying because, whilst I sympathize with the idea of a more modern look and feel, making a change that basically just gave you rounded buttons and a few shadows here and there, has wasted two days of my time.
And then the solution (the interim solution we had) isn't something I feel totally comfortable with. What if, for example, thousands of existing users who don't happen to have that control now have the client fail? What if some people don't have UxTheme.dll?
You have already complained here that you don't want to make changes "to fix a bug affecting YOUR version of MFC only". Well, how can you say with confidence that it will work whatever we do?
Certainly no-one predicated that adding in the manifest file would cause corruption in the notepad window. So I wonder what else unexpected will happen?
If Microsoft supported their developers (like Apple do, and Linux) by giving away the development tools, then I could accept that I should have the most modern tools. But when it is a thousand dollars every three or four years (after all, there is VS2005, VS2008, VS2010, then I feel like I am just giving them money for basically bug fixes. Big money. Especially when I get practically no income from MUSHclient.
|