there is a wish to include it's registration and WndProc into separate "INC" and to "forget".
- There is a registered custon control
- The control has its own callback function, which doesn't receives the palette messages.
- To correctly respond to the palette messages, and to redraw the controls after each message, there should be a main dialog callback function. But you risk to forget to include it.
The solution could be to include a little code to check for the main dialog callback function. Assume the control callback includes the following code:
Code:
LOCAL a AS LONG a = 0 SendMessage CBHNDL, %WM_USER + 123, VARPTR( a ), 123 IF a <> 123 THEN MSGBOX "ERROR: CUSTOM CONTROL......." END IF
Code:
LOCAL a AS LONG PTR IF CBMSG = %WM_USER + 123 THEN a = CBWPARAM @a = CBLPARAM END IF
Your separate "INC" should contain the custom control code and a standard palette messages handler function. This function will be declared as a callback function for the dialogs - if you forget to decalre it, you'll get an error message. Very little and fast code.
Aldo
------------------
Leave a comment: