What message should my MFC management dialog receive before I can change it?

I have a custom MFC CMyDialog dialog with a custom CMyControl control added using the resource editor. The dialog box has a member variable for the control and has DDX configured.

The control accepts messages with paints and has its own paint-based handler. But I want to have the equivalent of OnInitDialog in the control, so it can safely do some initialization when creating - putting code in the constructor leads to problems.
I tried adding handlers for the WM_CREATE, WM_NCCREATE messages and adding overrides in CWnd :: Create ... but none of them work.

What should I look to know how to edit it safely?

+3
source share
3 answers

MFC . WM_CREATE, , . PreSubclassWindow , . MFC WM_INITDIALOG.

+4

CWnd:: Create? , (CWnd:: Create()), . .

PreSubclassWindow.

, - .

0
  • WM_CREATE.
  • , OnCreate ​​.
  • ASSERT OnCreate
    (, , ).
  • , , , .

.

0

Source: https://habr.com/ru/post/1721793/


All Articles