Panic 46 .. problem with Code given
| Wed, 2006-03-08 12:12 | |
|
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); |
|






Forum posts: 194
- 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
Forum posts: 39
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
Forum posts: 276
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.
Forum posts: 364
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.