工程->添加工程->components and controls打开visual c++ components先中Splash screen.lnk然后点insert 然后确定然后OK编译,看看是不是你要的
比如你有多个对话框,你想像vb一样通过设置来启动一个窗口,这在MFC中是不可以的 你只有在App类中改变类的名称 如: BOOL CDlgTestApp::InitInstance() { AfxEnableControlContainer(); // Standard initialization // If you are not using these features and wish to reduce the size // of your final executable, you should remove from the following // the specific initialization routines you do not need.#ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif//注意这里... CDlgTestDlg dlg;//你可以修改这边的对话框类名称改变启动的對話框 m_pMainWnd = &dlg; int nResponse = dlg.DoModal(); if (nResponse == IDOK) { // TODO: Place code here to handle when the dialog is // dismissed with OK } else if (nResponse == IDCANCEL) { // TODO: Place code here to handle when the dialog is // dismissed with Cancel } // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. return FALSE; }
工程->添加工程->components and controls 选中Splash screen.lnk
你只有在App类中改变类的名称
如:
BOOL CDlgTestApp::InitInstance()
{
AfxEnableControlContainer(); // Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif//注意这里...
CDlgTestDlg dlg;//你可以修改这边的对话框类名称改变启动的對話框
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
} // Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
选中Splash screen.lnk