Getting size of the list window.
-
Can I call GetClientRect() to retrieve the size of the list window ( a child control to the dialog) in the constructor of the dialog box. Example: CMyDialog::CMyDialog() { CRect rect; m_List.GetClientRect(&rect); } Normally, the function is invoked in the InitDialog() function?. I am bit confused about this. thanks for help in advance NSS
-
Can I call GetClientRect() to retrieve the size of the list window ( a child control to the dialog) in the constructor of the dialog box. Example: CMyDialog::CMyDialog() { CRect rect; m_List.GetClientRect(&rect); } Normally, the function is invoked in the InitDialog() function?. I am bit confused about this. thanks for help in advance NSS
-
Can I call GetClientRect() to retrieve the size of the list window ( a child control to the dialog) in the constructor of the dialog box. Example: CMyDialog::CMyDialog() { CRect rect; m_List.GetClientRect(&rect); } Normally, the function is invoked in the InitDialog() function?. I am bit confused about this. thanks for help in advance NSS
Probably you are interested in doing something like this in the constructor:
CListCtrl \*pW = (CListCtrl \*)GetDlgItem(IDC\_LIST1); CRect rc; if ( pW ) { pW->GetClientRect(&rc); int z = 1; // Debug point }
When executing the first line, you come to the following assertion:
ASSERT(::IsWindow(m_hWnd))
which actually tells you that the child window is not a window yet. That is why you have to place the code inOnInitDialog()
SkyWalker -- modified at 3:10 Monday 10th October, 2005 -
Probably you are interested in doing something like this in the constructor:
CListCtrl \*pW = (CListCtrl \*)GetDlgItem(IDC\_LIST1); CRect rc; if ( pW ) { pW->GetClientRect(&rc); int z = 1; // Debug point }
When executing the first line, you come to the following assertion:
ASSERT(::IsWindow(m_hWnd))
which actually tells you that the child window is not a window yet. That is why you have to place the code inOnInitDialog()
SkyWalker -- modified at 3:10 Monday 10th October, 2005 -
Probably you are interested in doing something like this in the constructor:
CListCtrl \*pW = (CListCtrl \*)GetDlgItem(IDC\_LIST1); CRect rc; if ( pW ) { pW->GetClientRect(&rc); int z = 1; // Debug point }
When executing the first line, you come to the following assertion:
ASSERT(::IsWindow(m_hWnd))
which actually tells you that the child window is not a window yet. That is why you have to place the code inOnInitDialog()
SkyWalker -- modified at 3:10 Monday 10th October, 2005Thanks for your help. NSS