Hello,
emWin 6.16. Function WM_SetCallback leads to a crush with this simple code:
Display All
With 5.44 version that worked great, but somewhere between 5.44 and 6.16 this call had been added:
There are lots of workarounds, that is not the point. It becomes an unpleasant surprise, for what possible purpose sending WM_SET_CALLBACK to a new cb may be useful??
emWin 6.16. Function WM_SetCallback leads to a crush with this simple code:
C Source Code
- static void (*cb_prev)(WM_MESSAGE *pMsg);
- //===============================================
- static void cb_new(WM_MESSAGE *pMsg)
- {
- switch (pMsg->MsgId)
- {
- default:
- cb_prev(pMsg);
- break;
- }
- }
- //===============================================
- static void _cbDialog(WM_MESSAGE *pMsg)
- {
- switch (pMsg->MsgId)
- {
- case WM_INIT_DIALOG:
- {
- WM_HWIN hItem = WM_GetDialogItem(pMsg->hWin, ID_WINCHILD_001);
- cb_prev = WM_SetCallback(hItem, cb_new);
- }
- break;
- default:
- WM_DefaultProc(pMsg);
- break;
- }
- }
WM__SendMessageNoPara(hWin, WM_SET_CALLBACK);
There are lots of workarounds, that is not the point. It becomes an unpleasant surprise, for what possible purpose sending WM_SET_CALLBACK to a new cb may be useful??