You Are Here:

Community: Developer Discussion Boards

#1 Old Help me in Active object in S60 2nd edition FP3 - 2007-11-19, 12:08

Join Date: Nov 2006
Posts: 422
Location: Rajkot
Send a message via Skype™ to Tanya
Tanya's Avatar
Tanya
Offline
Regular Contributor
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.
Reply With Quote

#2 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-19, 12:27

Join Date: Mar 2003
Posts: 61
anttij
Offline
Regular Contributor
Is CLocStringCBS really inherited from CActive? And if so, shouldn't you be using the CActive's iStatus in the asynch request handling?
Reply With Quote

#3 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-19, 12:49

Join Date: Nov 2006
Posts: 422
Location: Rajkot
Send a message via Skype™ to Tanya
Tanya's Avatar
Tanya
Offline
Regular Contributor
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.
Reply With Quote

#4 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-19, 14:08

Join Date: Sep 2004
Posts: 7,940
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Online
Forum Nokia Expert
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).
Reply With Quote

#5 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-20, 05:49

Join Date: Nov 2006
Posts: 422
Location: Rajkot
Send a message via Skype™ to Tanya
Tanya's Avatar
Tanya
Offline
Regular Contributor
Hi

Quote:
Originally Posted by ltomuta View Post
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).

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.
Reply With Quote

#6 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-20, 07:17

Join Date: Feb 2005
Posts: 68
arunpirku
Offline
Regular Contributor
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
Reply With Quote

#7 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-20, 08:30

Join Date: Sep 2004
Posts: 7,940
Location: Tampere, Finland
ltomuta's Avatar
ltomuta
Online
Forum Nokia Expert
Quote:
Originally Posted by arunpirku View Post
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
It is true, the error message is not shown on CE devices by default. This trick however will enable them back on most devices.

There are also software tools that are able to gather panic info, I'll update this message if I remember the details about them.
Reply With Quote

#8 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-20, 11:29

Join Date: Feb 2006
Posts: 16,374
Location: Zürich, Switzerland
wizard_hu_'s Avatar
wizard_hu_
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.
Reply With Quote

#9 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-21, 08:25

Join Date: Nov 2006
Posts: 422
Location: Rajkot
Send a message via Skype™ to Tanya
Tanya's Avatar
Tanya
Offline
Regular Contributor
Quote:
Originally Posted by wizard_hu_ View Post
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.
hi

i used following way

DoSomethingAsync(iStatus);
SetActive();

Tanya
Last edited by Tanya : 2007-11-21 at 10:16.
Reply With Quote

#10 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-11-21, 13:58

Join Date: Feb 2005
Posts: 68
arunpirku
Offline
Regular Contributor
Quote:
Originally Posted by Tanya View Post
hi

i used following way

DoSomethingAsync(iStatus);
SetActive();

Tanya
Is CLocStringCBS added to active scheduler?
Reply With Quote

#11 Old Re: Help me in Active object in S60 2nd edition FP3 - 2007-12-11, 16:59

Join Date: Dec 2007
Posts: 1
symdroid_2007
Offline
Registered User
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
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 Edition FP2: Looking for Active Perl 5.6.1 build 531 xjussix Symbian Tools & SDKs 17 2007-06-25 05:49
S60 2nd (FP3) Emulator and InfoMsg jmak Symbian Tools & SDKs 1 2007-03-22 06:35

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia