×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Jul 2005
    Posts
    168

    CActive in an exe

    hi,
    in my server.exe, i want to handle some requests with an active object named iActive, but there is a problem. When a request is made, the server crashes. Look at some of my server.exe :

    GLDEF_C TInt E32Main()
    {
    ........classicals here
    TRAPD(mainError, DoStartL());
    .........classicals here
    }

    LOCAL_C void DoStartL()
    {
    CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
    CleanupStack::PushL(scheduler);
    CActiveScheduler::Install(scheduler);

    CWatcherServer::New();
    CActiveScheduler::Start();

    CleanupStack::PopAndDestroy(scheduler);
    }

    void CWatcherServer::New()
    {
    CWatcherServer *pS=new CWatcherServer(EPriority);
    __ASSERT_ALWAYS(pS!=NULL,PanicServer(ESvrCreateServer));
    pS->StartL(KServerName);
    }

    and below is the function of server.exe that handles requests comes from client, in this function i start my active object, look :

    void CWatcherSession:ispatchMessageL(const RMessage &aMessage)
    {
    switch (aMessage.Function())
    {
    case EStartWatcher:
    {
    iActive = CWholeEngine::NewL(); // my CActive object is created
    iActive->StartWatcher(); // with an asynchronous func and then SetActive()
    // has crashed now
    }
    return;
    default:
    PanicClient(EBadRequest);
    return;
    }
    }

    what can be the problem here...

  2. #2
    Regular Contributor
    Join Date
    Jul 2005
    Posts
    185

    Re: CActive in an exe

    How about CTrapCleanup?

  3. #3
    Registered User
    Join Date
    Apr 2005
    Location
    Barcelona
    Posts
    1,678

    Re: CActive in an exe

    Difficult to tell with such snippet. Some guesses: make sure you add the active objects to the scheduler when constructing. Also, it'd help to know the exact cause of the crash (category, reason).

  4. #4
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CActive in an exe

    Post the StartWatcher source code and the error code.

    there are also numerous threads on the forums showing how to enable error messages

  5. #5
    Regular Contributor
    Join Date
    Jul 2005
    Posts
    168

    Re: CActive in an exe

    okay look, i realized, not the asynchronous request, but a call
    in constructing the CActive-based derived object :
    CLogClient::NewL(CEikonEnv::Static()->FsSession());
    makes the server crashes. What do you think?

  6. #6
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    94

    Re: CActive in an exe

    I don't think you have a CEikonEnv in an exe. That's given to you by the framework only in the case of graphical applications. So just declare another RFs and Connect() to it.

    S.

  7. #7
    Regular Contributor
    Join Date
    Jul 2005
    Posts
    168

    Re: CActive in an exe

    so thanks...
    it works now.

Similar Threads

  1. Replies: 6
    Last Post: 2006-11-30, 03:44
  2. Killing an Exe during boot time
    By santosh shetty in forum Symbian
    Replies: 2
    Last Post: 2006-06-13, 05:48
  3. EXE run EXE
    By jend_rommel in forum Symbian
    Replies: 3
    Last Post: 2006-03-08, 01:48
  4. Testing an EXE that looks for a file
    By ViruDoshi in forum Symbian
    Replies: 2
    Last Post: 2006-01-30, 10:52
  5. KERN EXE 3 panic in exe
    By santosh shetty in forum Symbian
    Replies: 3
    Last Post: 2006-01-11, 08:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •