Hi !

I have a Sockets engine class in my application . I create the engine object in the AppUi with the following code .

Code:
void CMyAppAppUi::ConstructL()

{
	...

  // Create socket engine
   iSocketsEngine = CSocketsEngine::NewL(*iappMyAppView,iLog);


}
The functions that get called as a result of the call to NewL() are as follows :

Code:
CSocketsEngine* CSocketsEngine::NewL(MUINotifier& aConsole,RFileLogger & aLog)
    {

        aLog.Write(_L("Entered NewL() of socketsengine..."));

        CSocketsEngine* self = CSocketsEngine::NewLC(aConsole,aLog);

        aLog.Write(_L("1"));

        CleanupStack::Pop(self);

       aLog.Write(_L("Exiting NewL() of socketsengine..."));

        return self;
    }
Code:
CSocketsEngine* CSocketsEngine::NewLC(MUINotifier& aConsole,RFileLogger & aLog)
    {

        aLog.Write(_L("Entered NewLC() of socketsengine..."));

        CSocketsEngine* self = new (ELeave) CSocketsEngine(aConsole);

        aLog.Write(_L("1"));

        CleanupStack::PushL(self);

        aLog.Write(_L("2"));

        self->ConstructL(aLog);

        aLog.Write(_L("Exiting NewLC() of socketsengine..."));

        return self;
    }
Code:
void CSocketsEngine::ConstructL(RFileLogger & aLog)
    {

        sLog = aLog ; 

        sLog.Write(_L("Entered ConstructL() of socketsengine..."));

        ChangeStatus(ENotConnected);

        ....
    }

Now, ChangeStatus() is defined as follows :

Code:
void CSocketsEngine::ChangeStatus(TSocketsEngineState aNewStatus)
    {

 
      sLog.Write(_L("Entered ChangeStatus() of socketsengine.."));

    // Update the status (and the status display)
    switch (aNewStatus)
        {
        case ENotConnected:
            sLog.Write(_L("ENotConnected"));
              iConsole.SetStatus(KStrNotConnected); //Panics here  
            break;
        case EConnecting:
            sLog.Write(_L("ENotConnecting"));
            iConsole.SetStatus(KStrConnecting);
            break;
        case EConnected:
            sLog.Write(_L("ENotConnected"));
            iConsole.SetStatus(KStrConnected);
            break;
        case ELookingUp:
            sLog.Write(_L("ELookingUp"));
            iConsole.SetStatus(KStrLookingUp);
            break;
        default:
            User::Panic(KPanicSocketsEngine, ESocketsBadStatus);
            break;
        }
        
    sLog.Write(_L("Out of switch..."));    

    iEngineStatus = aNewStatus;

    sLog.Write(_L("Exiting ChangeStatus() of socketsengine.."));
    }
Now , when I run my application , it panics with KERN-EXEC 3 . Looking at the logs i see that ENotConnected gets printed , however the code panicked while executing iConsole.SetStatus(KStrNotConnected) .
Could you tell me whats wrong ? . Id be glad to share more code in case you need some more information to fix this.


Please help.

Thanks a lot