Re: VS_VERSION_INFO static ctrl
Yea, I was using another format function but having problems with an
assertion, so I tried your CString method. But I am still getting the
assertion, I must not be calling it correctly. I first tried it in the
dialog constructor, and got the assertion.
So then I tried it in the handler that calls the dialog, but got
the same assertion. I am foo barring somewhere.
Code below.
//// CAboutDlg dialog used for App About
//
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
CStatic m_CtrlStaticCr;
CStatic m_CtrlStaticVer;
//}}AFX_DATA
//............
}
//// DDX Stuff
//
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
DDX_Control(pDX, IDC_STATICcr, m_CtrlStaticCr);
DDX_Control(pDX, IDC_STATICver, m_CtrlStaticVer);
//}}AFX_DATA_MAP
}
//// handler that runs the dialog
//
void CFileHandlingApp::OnAppAbout()
{
CAboutDlg aboutDlg;
CString s;
s.Format( _T(" version %d.%d.%d.%d"), VERMAJ, VERMIN, VERFIX, BUILDNUMBER );
aboutDlg.m_CtrlStaticVer.SetWindowText(s); //gets a Debug Assertion Failed
aboutDlg.DoModal();
}