Home » U++ Library support » U++ Core » [BUG] wParam casting in Ctrl::sProcessMSG
[BUG] wParam casting in Ctrl::sProcessMSG [message #41301] |
Thu, 28 November 2013 08:55 |
Zbych
Messages: 325 Registered: July 2009
|
Senior Member |
|
|
Hi,
There should be one more (or one less) casting of msg.wParam to int in Ctrl::sProcessMSG.
Right now when msg.wParam is bigger than 0x80000000, upp application crashes.
Version1:
void Ctrl::sProcessMSG(MSG& msg)
{
if (msg.message == WM_HOTKEY) {
if((int)msg.wParam >= 0 && (int)msg.wParam < Ctrl::hotkey.GetCount())
//^^^^^^^^^^
Ctrl::hotkey[(int)msg.wParam]();
return;
}
Version2:
void Ctrl::sProcessMSG(MSG& msg)
{
if (msg.message == WM_HOTKEY) {
if(msg.wParam < (unsigned)Ctrl::hotkey.GetCount())
//^^^^^^^^^^
Ctrl::hotkey[(int)msg.wParam]();
return;
}
|
|
|
|
Goto Forum:
Current Time: Thu Apr 18 12:36:01 CEST 2024
Total time taken to generate the page: 0.02083 seconds
|