Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
The first approach to creating type-safe access to controls uses an inline member function to cast the return type of class CWnd's GetDlgItem member function to the appropriate C++ control type, as in this example:
CButton* CMyDialog::GetMyCheckbox()
{
return (CButton*)GetDlgItem(IDC_CHECKBOX);
}
You can then use this member function to access the control in a type-safe manner with code similar to the following:
GetMyCheckbox()->SetCheck(BST_CHECKED);