CToolTipCtrl::RelayEvent
-
Hello! I've read that when working with the CToolTipCtrl, you have to either relay the mouse messages to it, or do some kind of subclassing. I've chosen to relay the messages, and I thought that the logical thing was to do this through OnMouseMove, and I did something like: void X::OnMouseMove(...) { MyToolTip.RelayEvent(const_cast(GetCurrentMessage())); } I used the const_cast because otherwise the compiler complained about GetCurrentMessage being const! Well... Didn't work! Now I have found out that I must relay the messages in PreTranslateMessage, and that works nicely... But why can't i relay in OnMouseMove ? Thanks in advance:)
-
Hello! I've read that when working with the CToolTipCtrl, you have to either relay the mouse messages to it, or do some kind of subclassing. I've chosen to relay the messages, and I thought that the logical thing was to do this through OnMouseMove, and I did something like: void X::OnMouseMove(...) { MyToolTip.RelayEvent(const_cast(GetCurrentMessage())); } I used the const_cast because otherwise the compiler complained about GetCurrentMessage being const! Well... Didn't work! Now I have found out that I must relay the messages in PreTranslateMessage, and that works nicely... But why can't i relay in OnMouseMove ? Thanks in advance:)
-
Hello! I've read that when working with the CToolTipCtrl, you have to either relay the mouse messages to it, or do some kind of subclassing. I've chosen to relay the messages, and I thought that the logical thing was to do this through OnMouseMove, and I did something like: void X::OnMouseMove(...) { MyToolTip.RelayEvent(const_cast(GetCurrentMessage())); } I used the const_cast because otherwise the compiler complained about GetCurrentMessage being const! Well... Didn't work! Now I have found out that I must relay the messages in PreTranslateMessage, and that works nicely... But why can't i relay in OnMouseMove ? Thanks in advance:)
Do it in
X::PreTranslateMessage()
Hope it will work.