| Reply | « Previous Thread | Next Thread » |
|
Hi
i tried to get location string(CBM). And for That i use following link. http://www.newlc.com/Mission-Impossible-Getting-the.html Above code do work perfect. But when i using above code with CActive Class than it do work perfectly in 2nd edition FP2 but not doing work in 2nd Edition FP3. After Call of SetActive Class my application closed. Why this happen please help me and give me solition. Code:
Appui.cpp
------------
void CTowerTrackerAppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EEikCmdExit:
{
Exit();
break;
}
case ETowerTrackerCmdGetCBM:
{
SendCBMRequestL();
break;
}
default:
break;
}
}
void CTowerTrackerAppUi::SendCBMRequestL()
{
// Issue CBM Request
iLocStrCBS->IssueRequest();
}
LocStringCBS.cpp
---------------
void CLocStringCBS::IssueRequest()
{
if( iStatus == KErrNone )
{
// Open the broadcastmessage objects
iBroadcastMsg.Open(iPhone);
RMobileBroadcastMessaging::TMobileBroadcastAttributesV1 attrInfo;
TPckg<RMobileBroadcastMessaging::TMobileBroadcastAttributesV1> des(attrInfo);
//Wait for the CBM
iBroadcastMsg.ReceiveMessage(iStatus,iGsmMsgdata,des);
//User::WaitForRequest(iStatus);
SetActive();
}
}
void CLocStringCBS::RunL()
{
if(iStatus.Int() == KErrNone)
{
iBroadcastMsg.Close();
// Close Broadcast message object
char locationString[94];
char cbuf;
int char_cnt=0;
unsigned int bb = 0;
/*8-bit to 7-bit conversion*/
unsigned char ur,curr,prev = 0;
int i = 0;
for (i=6; i<iGsmMsgdata.Length(); i++)
{
.
.
.
}
locationString[char_cnt] = '\0';
int len=0;
while(locationString[len] != NULL)
{
len++;
}
// Create empty descriptor
HBufC* nameHeap = HBufC::NewLC(len);
TPtr namePtr(nameHeap->Des());
// Copy contents
for(int i=0; i<len; i++)
{
namePtr.Append((TChar)locationString[i]);
}
//now you have the location string
//do whatever you want here..
namePtr.Trim();
// Pop descriptor from cleanup stack
CleanupStack::PopAndDestroy( nameHeap);
}
}
LocStringCBS.h
--------------
class CLocStringCBS : public CActive
{
public:
private:
enum TLocStringCBSState
{
EUninitialized, // Uninitialized
EInitialized, // Initalized
EError // Error condition
};
private:
TInt iState; // State of the active object
RTelServer iTelServer;
RMobilePhone iPhone;
RTelServer::TPhoneInfo iPhoneInfo;
RMobileBroadcastMessaging iBroadcastMsg;
//GSM CBM's length is 88 bytes
TBuf8<256> iGsmMsgdata;
};
#endif
Regards Tanya
Last edited by Tanya : 2007-11-20 at 05:52.
|
|
Is CLocStringCBS really inherited from CActive? And if so, shouldn't you be using the CActive's iStatus in the asynch request handling?
|
|
Hi
Sorry i do not write in above code but iReqStatus is iStatus. i update LocStringCBS.h in above code. But i do work perfect in 2nd edition FP3.
Last edited by Tanya : 2007-11-19 at 13:26.
|
|
CActive has a TRequestStatus iStatus member variable which is inherited by your CLocStringCBS too. That is the variable that you must use and not a new TRequestStatus.
You only instantiate TRequestStatus objects when you intend to use asynchronous requests without an Active Object but that is bad practice anyway. As a general note, no application simply closes unless you explicitly call Exit. If the application panics due to an internal error please spend some time to find out the panic code and therefore the reason for your problem. I am sick and tired of developers who don't have the common sense of looking for the error code when the error occurs (or don't care to mention it when asking for help). |
|
Hi
Quote:
Each and Every Forum if i face any panic code than i write in my forum's if you want than also you can see previous posted forums. i tried with iStatus in FP3. iReqStatus i used for Asyn. process. First i tried to on Click Event(with Synch. process) that work properly in both 2nd edition FP2 and FP3 but when i tried to implement with Active class(Asynchronous programming using CActive) than it work only with 2nd edition FP2 but do not work with FP3. And Above application's project i have done in 2nd edition FP2. but it's create problem in FP3. And really it's not give me any panic code in mobile phone. Regards Tanya
Last edited by Tanya : 2007-11-20 at 06:57.
|
|
Hi Itomota,
While using s60 2nd edition most of the phones (i tried with 6680, 6600, n72, 7610) will not show any panc code. The application just crashes. Please do let us know if there is anything to be done (settings or third party applications) so that the devices will show panic codes. Tanya: Is CLocStringCBS added to active scheduler? regards arun |
|
Quote:
There are also software tools that are able to gather panic info, I'll update this message if I remember the details about them. -- Lucian Today's useful link: On device debugging - screencasts Yesterday's useful link: How do I start programming for Symbian OS? Latest blog post: Upgrade to Carbide.c++ 2.4
|
|
Join Date: Feb 2006
Posts: 16,442
Location: Zürich, Switzerland
Offline
Forum Nokia Champion
|
|
I still do not understand. You have an active object, and you have declared "TRequestStatus iReqStatus;" in it. Do you use this member variable? And if yes, why and what do you expect from it?
Remember that the active scheduler and the active objects are able to deal with CActive::iStatus only. If you use "DoSomethingAsync(iReqStatus);SetActive();" it will not work. |
| wizard_hu_ |
| View Public Profile |
| Find all posts by wizard_hu_ |
|
Quote:
i used following way DoSomethingAsync(iStatus); SetActive(); Tanya
Last edited by Tanya : 2007-11-21 at 10:16.
|
|
Is CLocStringCBS added to active scheduler?
|
|
Tanya,
Did you really get the location string on a S60 2nd ed Fp 2 phone, if so which libraries and where. I have been searching everywhere and have found that you can get it on all but these phones. Please help me and let me know how you did this |
| symdroid_2007 |
| View Public Profile |
| Find all posts by symdroid_2007 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| S60 2nd Edition FP2: Looking for Active Perl 5.6.1 build 531 | xjussix | Symbian Tools & SDKs | 19 | 2009-12-23 04:55 |
| Activate loudspeaker in S60 2nd Edition | koanessie | Symbian Media (Graphics & Sounds) | 3 | 2007-11-11 09:40 |
| S60 2nd and 3rd edition SDK's conflict HEEELP | stefanbefa | Symbian Tools & SDKs | 10 | 2007-10-26 11:34 |
| S60 2nd Edition, FP3 | groo.chi | Series 40 & S60 Platform Feedback | 0 | 2007-09-24 08:26 |
| S60 2nd (FP3) Emulator and InfoMsg | jmak | Symbian Tools & SDKs | 1 | 2007-03-22 06:35 |