Panic 46 .. problem with Code given

Login to reply to this topic.
Wed, 2006-03-08 12:12
Joined: 2005-02-22
Forum posts: 39
I am writing an application which uses the 3rd Party APIs
(Mobinfo ) for collecting the network related data ..

But it throughs Panic 46 on devices when i call the following Function ..


   TRequestStatus stat = TRequestStatus(10);
                TBuf<15> num;
      
   //   SetActive();
      
                   minfo->GetIMSI(num,stat); 

/* *** at this point it goes throughs panic 46  ... I am not able to understand why it thoughs panic ... is there any other way to pass parameters ***/
         
          //  User::WaitForRequest();
    // User::LeaveIfError();int safety = 0;
   
                   int counter =0;
   Ã‚    while(counter < 500000)
   Ã‚       {
         Ã‚   
   Ã‚            counter++;
   Ã‚           iEikonEnv->InfoMsg(R_MOBITEST_TEXT_ITEM1);
            if (stat.Int() != KRequestPending)
            iEikonEnv->InfoMsg(R_MOBITEST_TEXT_ITEM0);
            counter = 600000;
         
            
         }
      
   //   wait
      minfo->CancelGetIMSI();
   //   minfo->GetOwnNumber(ownno,stat);

Wed, 2006-03-08 19:06
Joined: 2006-03-04
Forum posts: 194
Re: Panic 46 .. problem with Code given
Is this in an active object or what? There's a SetActive() which suggests it is but its commented out by the looks of things. If it is an active object then you need to go and re-read about them, you:
- must always all setactive()
-you must never call User::WaitForRequest in an active object
- you shouldn't declare another TRequestStatus in an active object


There's various articles/books on how to use active objects, make sure you read it and understand it and your code follows the same pattern of use as described in the articles.

Its panicing because you are making a call to an asynchronous function but there is nothing to capture the request once signalled by that function.

P.S.
With respect Raja what are you talking about, your suggestions have got nothing to do with a stray signal which is what a user 46 panic is
Fri, 2006-03-10 10:44
Joined: 2005-02-22
Forum posts: 39
Re: Panic 46 .. problem with Code given
Hi ,

Thanks for the reply

getNWData()
{

TRequestStatus stat = TRequestStatus(10);
TBuf<15> num;
minfo->GetIMSI(num,stat); 

/* *** at this point it goes throughs panic 46  ... I am not able to understand why it thoughs panic ... is there any other way to pass parameters ***/
         
    /***

     Here I wan to Grab the data  ' num' and use
 
     The Object  minfo is an object from a 3rd party class   
     CMobileInfo
   
     I am not making any active object class but it seems
     that CMobileInfo implements one ..

I am not able figure out how  to use this API
   
***/
     
     minfo->CancelGetIMSI();

}

-----------------------------------------------
   This is what i actually want to do ?

Also i am calling this function from HandleCommandL(TInt aCommand) of my appui 

Will it have some effect on it ??

Please suggest ...

Regards
Veeraj Thaploo
 
   

Fri, 2006-03-10 12:54
Joined: 2004-12-03
Forum posts: 276
Re: Panic 46 .. problem with Code given
Hello Veeraj,

I think you are confused with asynchronous function call and synchronous function call. you calling a asynchronous function and expecting it to behave syncronously....

minfo->GetIMSI(num,stat); 

The above function is an  asynchronous function, so you won't get the result immediately after this call. You will only get the result in the RunL routine...

The panic you are getting because you calling cancel immediately after call to a request function....

I will suggest first read about Active objects and asyncronous calls, then only you can have a better understanding..

Today is a gift by GOD, that's why it is called the present.

Fri, 2006-03-10 21:36
Joined: 2004-07-10
Forum posts: 364
Re: Panic 46 .. problem with Code given
Somebody has already pointed you at documentation regarding how to use this API

http://discussion.forum.nokia.com/forum/showthread.php?t=75913

and there are millions of documents available describing how to use active objects. Including millions of posts in this forum and the Nokia forum describing exactly the situation you have posted.

Go and study.
  • Login to reply to this topic.