×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Aug 2008
    Posts
    54

    Null pointer problem{help}

    hi.m tring to get task id through following code:

    1.TApaTaskList taskList(CCoeEnv::Static()->WsSession());
    2.TApaTask task(taskList.FindByPos(0));
    3.TInt window =task.WgId();
    through line no.2 m tring to get the task which is currently using.
    and in line 3 m getting the task id.
    but the problem reside in line 1.where WSSession is null thus a panic name kern exe3 arised due to null pointer.how will i remove this.kindly help me.

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: Null pointer problem{help}

    Hi,
    I guess yours is a GUI less application that's why when you are trying to get the CCoeEnv* through CCoeEnv::Static() you are getting NULL pointer.
    You will have to create your own CCoeEnv to use it in your application.
    Maximus
    S60 Developer
    Impossible is nothing

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Null pointer problem{help}

    RWsSession is just a class, you can also instantiate for yourself. Of course in this case you should remember that it is an R-class, so some kind of open-close is required, which happen to be Connect and Close:
    Code:
    RWsSession session;
    User::LeaveIfError(session.Connect());
    CleanupClosePushL(session);
    ...your code...
    CleanupStack::PopAndDestroy(); // session

Similar Threads

  1. Please its veru urgent on nokia 3250
    By siva_guduru in forum Mobile Java General
    Replies: 8
    Last Post: 2008-05-01, 10:24
  2. Video playback with sound but nothing on Screen
    By abdullah829 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2007-11-30, 14:04
  3. RecordEnumeration throwing null pointer exception
    By kralvarado in forum Mobile Java General
    Replies: 2
    Last Post: 2006-04-13, 04:07
  4. getNumRecords/ null pointer exception
    By cjmarsha in forum Mobile Java General
    Replies: 3
    Last Post: 2005-07-30, 13:09
  5. another Null pointer exception
    By kvchen1985 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2004-06-28, 15:33

Posting Permissions

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