Hi I have problem displaying splash screen
The problem is the screen blocks for three seconds showing nothing and then image just flashes for minor sec and goes off.
I am attaching the code please help..
// The calling code before starting my AppUi
StatusPane()->MakeVisible(EFalse);
CSplashContainer *splash = new (ELeave) CSplashContainer();
CleanupStack::PushL( splash );
splash->SetMopParent( this );
splash->ConstructL(ApplicationRect());cd
AddToStackL( splash );
splash->ActivateL();
splash->DrawNow();
User::After(3000000);
RemoveFromStack( splash );
CleanupStack::PopAndDestroy();
StatusPane()->MakeVisible(ETrue);
My CSplashContainer class looks like this..
oid CSplashContainer::ConstructL(const TRect& aRect)
{
CSmartProfileAppUi *appUi = (CSmartProfileAppUi*)iEikonEnv->AppUi();
CreateWindowL();
TFileName aSplashMifFileName;
_LIT(KSplashFilePath, "\\resource\\apps\\MobiSecureSplash.mif");
TParse parse;
parse.Set(appUi->Application()->AppFullName(), NULL, NULL);
aSplashMifFileName.Copy(parse.Drive());
aSplashMifFileName.Append(KSplashFilePath);
iSplashBitmap = AknIconUtils::CreateIconL(aSplashMifFileName,EMbmMobiantispamsplashAntispam_1);
AknIconUtils::SetSize( iSplashBitmap, aRect.Size(),EAspectRatioNotPreserved );
SetRect(aRect);
ActivateL();
}
// Destructor
CSplashContainer::~CSplashContainer()
{
delete iSplashBitmap;
}
// ---------------------------------------------------------
// CSplashContainer::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CSplashContainer::SizeChanged()
{
}
// ---------------------------------------------------------
// CSplashContainer::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CSplashContainer::CountComponentControls() const
{
return 0; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CSplashContainer::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CSplashContainer::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
default:
return NULL;
}
}
// ---------------------------------------------------------
// CSplashContainer:raw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CSplashContainer:raw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
gc.BitBlt(TPoint(0, 0), iSplashBitmap);
}
// ---------------------------------------------------------
// CSplashContainer::HandleControlEventL(
// CCoeControl* aControl,TCoeEvent aEventType)
// ---------------------------------------------------------
//
void CSplashContainer::HandleControlEventL(
CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
{
// TODO: Add your control event handler code here
}
TKeyResponse CSplashContainer::OfferKeyEventL(
const TKeyEvent& aKeyEvent,
TEventCode aType )
{
return EKeyWasNotConsumed;
}
void CSplashContainer::MiuoConvertComplete(TInt aError)
{
CActiveScheduler::Stop();
}
void CSplashContainer::MiuoCreateComplete(TInt aError)
{
}
void CSplashContainer::MiuoOpenComplete(TInt aError)
{
CActiveScheduler::Stop();
}
// End of File

raw(const TRect& aRect) const
Reply With Quote



