SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
This sample illustrates input validation.
The source code is located at C:\Program Files (x86)\Softelvdm\SftMask OCX 7.0\Samples\VC++\Sample4\Sample4Dlg.cpp or C:\Program Files\Softelvdm\SftMask OCX 7.0\Samples\VC++\Sample4\Sample4Dlg.cpp (on 32-bit Windows versions).
BOOL CSample4Dlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // set up variables for all SftMask/OCX controls m_vSftMaskName = m_CtlName.GetControlUnknown(); _ASSERT(m_vSftMaskName != NULL); m_vSftMaskCompany = m_CtlCompany.GetControlUnknown(); _ASSERT(m_vSftMaskCompany != NULL); m_vSftMaskZIP = m_CtlZIP.GetControlUnknown(); _ASSERT(m_vSftMaskZIP != NULL); m_vSftMaskDate = m_CtlDate.GetControlUnknown(); _ASSERT(m_vSftMaskDate != NULL); m_vSftMaskTelephone = m_CtlTelephone.GetControlUnknown(); _ASSERT(m_vSftMaskTelephone != NULL); m_vSftMaskAmount = m_CtlAmount.GetControlUnknown(); _ASSERT(m_vSftMaskAmount != NULL); return TRUE; // return TRUE unless you set the focus to a control } void CSample4Dlg::OnCustomValidationSftMaskZip(BOOL FAR* Cancel) { if (m_vSftMaskZIP->Text != _bstr_t("11111")) { *Cancel = TRUE; } } void CSample4Dlg::OnOK() { if ((m_vSftMaskName->Contents->GetValid() == VARIANT_TRUE) & (m_vSftMaskCompany->Contents->GetValid() == VARIANT_TRUE) & (m_vSftMaskZIP->Contents->GetValid() == VARIANT_TRUE) & (m_vSftMaskDate->Contents->GetValid() == VARIANT_TRUE) & (m_vSftMaskTelephone->Contents->GetValid() == VARIANT_TRUE) & (m_vSftMaskAmount->Contents->GetValid() == VARIANT_TRUE)) { CDialog::OnOK(); } else { ::MessageBox(NULL, _T("There are validation errors - Please correct the data entered."), _T("Form Errors & Warnings"), MB_OK|MB_TASKMODAL); } } BEGIN_EVENTSINK_MAP(CSample4Dlg, CDialog) //{{AFX_EVENTSINK_MAP(CSample4Dlg) ON_EVENT(CSample4Dlg, IDC_SFTMASKZIP, 9 /* CustomValidation */, OnCustomValidationSftMaskZip, VTS_PBOOL) //}}AFX_EVENTSINK_MAP END_EVENTSINK_MAP()