I have a simple MFC MDI application, where there is main CFormView, in which there is CListCtrl control. I want to set its extended styles like below:
m_listctrl.SetExtendedStyle(LVS_EX_DOUBLEBUFFER|LVS_EX_GRIDLINES);
Question is where should I place this initialisation code? I tried to put it in CMyFormView constructor, but I realised that my CListCtrl control is created in CMyFormView::DoDataExchange(), by:
DDX_Control(pDX, IDC_LIST_INVENTORY, m_listctrl);
So constructor is before DoDataExchange() and will cause Assert failure.
Call
SetExtendedStyle()in theOnInitDialog()override (WM_INITDIALOGhandler).