简体   繁体   中英

MFC Controls on Dialog don't appear until the mouse move over them

I'm moving from OWL. I created a dialog class called TDialog inheriting from CDialog and I override the OnWndMsg to allow OWL event handling to work also beside the MFC. OWL uses Response Table (another form of the message map it is specification for OWL) at the same time I call the base's method CWnd::OnWndMsg . The problem is that all controls on the dialog aren't visible until the mouse move over them or minimizing the dialog and then restoring it then all controls will be redrawn.

Another problem is that when I click the OK button [Id = IDOK] the dialog is closed but an exception is thrown. I think this is because we processed the message twice so the handle may be closed.

What is the best way to process the message multiple times in a case like this?

The problem was that I was processing the message on OWL and on the same time on MFC set background color message and erase the background also caused the problem when i removed the OWL processing of message the problem was solved, to process the messages in OWL I have 2 solutions now

  1. To remap the OWL macros like DEFINE_RESPONSE_TABLE1... and replace the definition with alternatives of MFC here come a new problem the difference in the signature of methods that receive event parameters like for example OnSysCommand in MFC and EVSysCommand in OWL
  2. To rewrite all response tables and replace them with MFC message maps [this solution is very expensive in time and efforts I have about 1700 response table]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM