怎样显示LOGO?
为了在软件打开时先出现一个LOGO,过几秒种后,再弹出对话框
我开了个线程,请问Sleep后,怎样回到主对话框?
我有一个用单文档做的例子
在Dialog 的App怎样实现呢?
代码如下:
BOOL CChatCntApp::InitInstance()
{
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
LoadStdProfileSettings();
//ADDITION OF SPLASH SCREEN COMPONENT
//Bring up the splash screen in a secondary UI thread
CSplashThread* pSplashThread = (CSplashThread*) AfxBeginThread(RUNTIME_CLASS(CSplashThread), THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
if (pSplashThread == NULL)
{
AfxMessageBox(_T("Failed to create splash screen"), MB_OK | MB_ICONSTOP);
return FALSE;
}
ASSERT(pSplashThread->IsKindOf(RUNTIME_CLASS(CSplashThread)));
//Tell the splash screen to load the bitmap from a resource called IDB_SPLASH.
//Alternatively, you could use the line:
// pSplashThread->SetBitmapToUse(GetHomeDirectory() + _T("TEST.BMP"));
//if you wanted the splasher code to load a bitmap from file at runtime.
pSplashThread->SetBitmapToUse(IDB_SPLASH);
pSplashThread->ResumeThread(); //Resume the thread now that we have set it up
Sleep(3000); //Simulate some slow loading process. Your code might
//load up some info from a file or make a network connection etc.
pSplashThread->HideSplash(); //Bring down the splash screen
CDialog* pDlg;
pDlg = new CDialog(
IDR_MAINFRAME,
RUNTIME_CLASS(CChatCntDlg),
RUNTIME_CLASS(CntSocket),
RUNTIME_CLASS(CCEnBitmap),
RUNTIME_CALSS(CPlaySoundThread),
RUNTIME_CALSS(CRecordSoundThread),
RUNTIME_CALSS(CTransparentStatic));
AddDialog(pDlg);
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
//ADDITION OF SPLASH SCREEN COMPONENT
//This is required to activate the normal mainframe, If you remove the splash
//screen, then the main frame window is brought up but will not
//be at the top of the Z Order.
m_pMainWnd->SetForegroundWindow();
return TRUE;
}
CString CChatCntApp::GetHomeDirectory()
{
TCHAR sFilename[_MAX_PATH];
TCHAR sDrive[_MAX_DRIVE];
TCHAR sDir[_MAX_DIR];
TCHAR sFname[_MAX_FNAME];
TCHAR sExt[_MAX_EXT];
GetModuleFileName(AfxGetInstanceHandle(), sFilename, _MAX_PATH);
_tsplitpath(sFilename, sDrive, sDir, sFname, sExt);
CString rVal(CString(sDrive) + CString(sDir));
int nLen = rVal.GetLength();
if (rVal.GetAt(nLen-1) != _T('\\'))
rVal += _T("\\");
return rVal;
}
上面RUNTIME_CLASS的地方是错的.请问在对话框中怎么实现?