Solved

MFC Splash Screen

Posted on 2000-02-24
5
930 Views
Last Modified: 2013-11-20
I've created an SDI application in Visual C++ 6.0.  I've added a splash screen component.  But when i run the application the main window opens then the splash screen.  I want the splash screen to open then go away and then the main application to open. Any help would be appreciated.

Thanks
0
Comment
Question by:Yozzer
5 Comments
 
LVL 30

Expert Comment

by:Zoppo
ID: 2554034
Hi Yozzer,

In InitInstance() do following

// after this line
CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);
// add this lines
CSplashWnd::ShowSplashScreen(NULL);
Sleep( 750 ); // see the value passed to SetTimer in CSplashWnd::OnCreate

and remove from CMainFrame::OnCreate() the line
CSplashWnd::ShowSplashScreen(NULL);

hope that helps,

ZOPPO
0
 
LVL 8

Accepted Solution

by:
VinExpert earned 50 total points
ID: 2554035
Hi,

Do this in the InitInstance of the app class after the call to AfxEnableControlContainer(); in the initinstance start

      CSplashWnd* pSplashWnd = new CSplashWnd;
      pSplashWnd->EnableSplashScreen(TRUE);
      pSplashWnd->ShowSplashScreen(m_pMainWnd);
      Sleep(2500);

For this open the Splash.h and make the constuctor as public

Hope this helps.
VinExpert


0
 

Author Comment

by:Yozzer
ID: 2554349
Thanks Zoppo and VinExpert

Both ways worked
0
 
LVL 3

Expert Comment

by:akalmani
ID: 2554365
Hi !!
        U r splash window component should be assigned as the main window and then show the splash window. Sleep for some time and then reassign the main window as u r SDI. That will solve the problem.
0
 
LVL 30

Expert Comment

by:Zoppo
ID: 2554377
:(
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now