Skip to main content
www.olaf-groeger.de

Main navigation

  • Home
  • NMR
  • Programming
    • Streams
    • Subclassing of edit controls
  • Software
    • Calimah Scheduler
    • ServicesCtl

Breadcrumb

  1. Home
  2. Programming
  3. Subclassing of Edit Controls
  4. Usage (e.g. In a Dialog Window)

Usage (e.g. in a dialog window)

By olaf , 3 July 2025
  1. Add a edit control to the dialog resource to the (e.g. ID=IDC_HER).
  2. Add a member variable of the type CHertzEdit to the dialog class (here: m_herEdit).
  3. Add the function DDX_HertzEdit as handler to the method DoDataExchange() of the dialog class:

    void CMyDialog::DoDataExchange(CDataExchange* pDX)
    {
            CDialog::DoDataExchange(pDX);
            //{{AFX_DATA_MAP(CParameterPage1)
            DDX_HertzEdit(pDX, IDC_HER, m_herEdit);
            //}}AFX_DATA_MAP
    }

  4. Call the method SubClassDlgItem() inside the method OnInitDialog of the dialog class:
    BOOL CMyDialog::OnInitDialog()
    {
            CDialog::OnInitDialog();
            m_herEdit.SubclassDlgItem(IDC_HER, this);
            return(TRUE);
    }

Book traversal links for 15

  • Implementation of the message handler for WM_KILLFOCUS
  • Up
  • Summary/Download

Language switcher

  • English
  • German
Powered by Drupal