Article ID: 157142
Article Last Modified on 11/21/2006
//////////////////////////////////////////
// CFormViewView.h
class CFormViewView : public CFormView
{
/// .... Standard code omitted
public:
//{{AFX_DATA(CFormtestView)
enum{ IDD = IDD_FORMVIEW_REGULAR };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
static int m_nIDD; //The ID for the dialog template that is used
// Attributes
public:
/// .... Standard code omitted
};
////////////////////////////////////////////////////////////////////////
//
// CFormViewView.CPP
//construction/destruction
//Set the default dialog template to IDD_FORMVIEW_REGULAR
int CFormViewView::m_nIDD = IDD_FORMVIEW_REGULAR;
CFormViewView::CFormViewView()
: CFormView(m_nIDD) //Use the static member variable for the
// template
{
/// .... Standard code omitted
}
////////////////////////////////////////////////////////////////////////
///
// CFormViewApp.CPP
BOOL CFormViewApp::InitInstance()
{
/// .... Standard code omitted
//Check version
OSVERSIONINFO osvi;
memset(&osvi, 0, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
GetVersionEx (&osvi);
//Set alternative template based on platform
if ((osvi.dwPlatformId == VER_PLATFORM_WIN32s) ||
((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) &&
(osvi.dwMajorVersion == 3) && (osvi.dwMinorVersion < 51)))
CFormtestView::m_nIDD = IDD_FORMVIEW_BOLD;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
return TRUE;
}
}Additional query words: 2.00 2.10 2.20 4.00 4.10 W32s kbdsd
Keywords: kbdocview kbnoupdate kbprb kbuidesign KB157142