Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtCheckBox class Collapse All
Subject Author Date
Black Spark Apr 10, 2005 - 7:09 AM

Hi!

I’m working in a dialog based application which is giving me some troubles with the CExtCheckBox class.

In one of the child dialogs I have 32 check boxes and they’re the only controls in there.

I’m assigning each member variable as a CExtCheckBox type variable and I cannot assign more then 14 member variables wihtout giving me troubles.

As soon as I put the "CExtCheckBox m_chkBox15;" in the header file the application won’t compile/run any more (Unhandled Exception...).

Am I doing something wrong or is it a bug? The code I’m using is the following:


-------------------------------------------------------------------------------------------

HEADER FILE:

#if !defined(AFX_PAGECHILD_H__9E21316E_7C7F_4E8E_B28F_7DC29EB448A3__INCLUDED_)
#define AFX_PAGECHILD_H__9E21316E_7C7F_4E8E_B28F_7DC29EB448A3__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageChild.h : header file
//
#include "PageBase.h"

/////////////////////////////////////////////////////////////////////////////
// CPageChild dialog

class CPageChild : public CPageBase
{
// Construction
public:
    CPageChild(CWnd* pParent = NULL); // standard constructor


// Dialog Data
    //{{AFX_DATA(CPageChild)
    enum { IDD = IDD_PAGE_CHILD };

    CExtCheckBox m_chkBox1;
    .
    .
    .
    CExtCheckBox m_chkBox32;
    //}}AFX_DATA

    
// Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CPageChild)
    protected:
    virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
    //}}AFX_VIRTUAL

// Implementation

    // Generated message map functions
    //{{AFX_MSG(CPageChild)
    virtual BOOL OnInitDialog();
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_PAGECHILD_H__9E21316E_7C7F_4E8E_B28F_7DC29EB448A3__INCLUDED_)

-------------------------------------------------------------------------------------------

IMPLEMENTATION FILE:

// PageChild.cpp : implementation file
//

#include "stdafx.h"
#include "Application.h"
#include "PageChild.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CPageChild dialog


CPageChild::CPageChild(CWnd* pParent /*=NULL*/)
    : CPageBase(CPageChild::IDD, pParent)
{
    //{{AFX_DATA_INIT(CPageChild)
    //}}AFX_DATA_INIT
}


void CPageChild::DoDataExchange(CDataExchange* pDX)
{
    CPageBase::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CPageChild)
    DDX_Control(pDX, IDC_CHECK_BOX1, m_chkBox1);
    .
    .
    .
    DDX_Control(pDX, IDC_CHECK_BOX32, m_chkBox32);
    //}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPageChild, CPageBase)
    //{{AFX_MSG_MAP(CPageChild)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPageChild message handlers

BOOL CPageChild::OnInitDialog()
{
    CPageBase::OnInitDialog();

    return TRUE; // return TRUE unless you set the focus to a control
     // EXCEPTION: OCX Property Pages should return FALSE
}

-------------------------------------------------------------------------------------------

Thanks in advance:

BlackSpark

Technical Support Apr 11, 2005 - 8:34 AM

You code seems to be correct. We created a test dialog project and put 32 check boxes onto the dialog . This project is compiled without any warnings and runs without any problems. So the error may hide somewhere your code. If you don’t find what’s wrong, please send it to us so that we can help you.