Fix a dangerous bug in CResizableLayout::AddAllOtherAnchors
::GetClassName(hWnd, szClassName, _countof(szClassName))
The third parameter is a character count, not a byte count.
In Unicode builds sizeof would give twice the length of the name buffer; and access violations might be expected; especially with a small buffer.
Not necessarily, but to make the code suitable for prehistoric VS versions, _countof(x) might be replaced with sizeof(x)/sizeof(x[0]).
Clear a rare debug assert in CResizableFormView::GetTotalClientRect
A trivial sequence "remove anchor - set window placement - add anchor" was fine in the first pass, but fired a debug asserts afterwards. The problem was in an attempted access to a non-existent scrollbar. An early check and return fixed this.
GetDeviceScrollSizes treats all non-positive mapping modes as invalid, and the condition nMapMode < 0 was changed accordingly.
Thanks @irwir
I'm no longer accustomed to writing good Unicode-compatible Windows code.
That probably comes from programming small microcontrollers, where wchar_t is a luxury you never have to deal with.
Fix a dangerous bug in CResizableLayout::AddAllOtherAnchors
::GetClassName(hWnd, szClassName, _countof(szClassName))
The third parameter is a character count, not a byte count. In Unicode buildssizeof
would give twice the length of the name buffer; and access violations might be expected; especially with a small buffer. Not necessarily, but to make the code suitable for prehistoric VS versions,_countof(x)
might be replaced withsizeof(x)/sizeof(x[0])
.Clear a rare debug assert in CResizableFormView::GetTotalClientRect A trivial sequence "remove anchor - set window placement - add anchor" was fine in the first pass, but fired a debug asserts afterwards. The problem was in an attempted access to a non-existent scrollbar. An early check and return fixed this.
GetDeviceScrollSizes
treats all non-positive mapping modes as invalid, and the conditionnMapMode < 0
was changed accordingly.