<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - CTelephony and CActive problem - Comments</title>
 <link>http://www.newlc.com/en/topic-17317</link>
 <description>Comments for &quot;CTelephony and CActive problem&quot;</description>
 <language>en</language>
<item>
 <title>Re: CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317#comment-36829</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;[quote author=Alcoran link=topic=17317.msg51606#msg51606 &lt;br /&gt;plz post also the error handling part in the RunL, that could be the reason.&lt;br /&gt;&lt;div class=&quot;quoteheader&quot;&gt;Quote&lt;/div&gt;&lt;div class=&quot;quote&quot;&gt;&lt;/div&gt;Thanks. It was the reason.&lt;br /&gt;Thaks to everybody!&lt;/div&gt;</description>
 <pubDate>Wed, 17 Jan 2007 12:31:02 +0100</pubDate>
 <dc:creator>tyatya</dc:creator>
 <guid isPermaLink="false">comment 36829 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317#comment-36828</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;any ideas?&lt;br /&gt;Help me please!&lt;/div&gt;</description>
 <pubDate>Mon, 15 Jan 2007 15:01:23 +0100</pubDate>
 <dc:creator>tyatya</dc:creator>
 <guid isPermaLink="false">comment 36828 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317#comment-36827</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;This is my client code using CMyTimer (it is HelloWorld template in main):&lt;br /&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;void CSymbian6AppUi::HandleCommandL( TInt aCommand )&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; switch( aCommand )&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EEikCmdExit:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case EAknSoftkeyExit:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exit();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; case ESymbian6Command1:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTimer-&amp;gt;StartL(1000000);//Start TASK!&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; default:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Panic( ESymbian6Ui );&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void CSymbian6AppUi::ConstructL()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; // Initialise app UI with standard value.&lt;br /&gt;&amp;nbsp; &amp;nbsp; BaseConstructL();&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; // Create view object&lt;br /&gt;&amp;nbsp; &amp;nbsp; iAppView = CSymbian6AppView::NewL( ClientRect() );&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; iTimer = CMyTimer::NewL(); //Create CMyTimer object&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;CSymbian6AppUi::~CSymbian6AppUi()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; if ( iAppView )&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delete iAppView;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iAppView = NULL;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; if ( iTimer )&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; delete iTimer;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; iTimer = NULL;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;Also i change my DoCancel():&lt;br /&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;void CMyTimer::DoCancel()&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(iState==EUninitialized)&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTimer.Cancel();&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else if(iState==EInitialized)&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTelephony-&amp;gt;CancelAsync(CTelephony::EGetPhoneIdCancel);&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;I still have same problem. &lt;img src=&quot;/en/sites/all/modules/smf_filter/smf_smileys/cry.gif&quot; alt=&quot;Cry&quot; border=&quot;0&quot; /&gt;&lt;/div&gt;</description>
 <pubDate>Fri, 12 Jan 2007 19:24:38 +0100</pubDate>
 <dc:creator>tyatya</dc:creator>
 <guid isPermaLink="false">comment 36827 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317#comment-36826</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;This code in isolation looks ok as far as getting the RunL() to run with the logic you have used (however the DoCancel is wrong). Your description therefore perhaps implies you are possibly using other active objects and the thing as a whole isn&amp;#039;t correct.&lt;br /&gt;&lt;br /&gt;The DoCancel is wrong because you are using one active object but have two asynchronous sources, in the DoCancel you can&amp;#039;t cancel them both, you have to know which one to cancel.&lt;/div&gt;</description>
 <pubDate>Fri, 12 Jan 2007 18:36:07 +0100</pubDate>
 <dc:creator>Fructose</dc:creator>
 <guid isPermaLink="false">comment 36826 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317#comment-36825</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;div class=&quot;codeheader&quot;&gt;Code:&lt;/div&gt;&lt;div class=&quot;code&quot;&gt;CMyTimer* CMyTimer::NewL()&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;CMyTimer* self = new (ELeave) CMyTimer();&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;CleanupStack::PushL(self);&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;self-&amp;gt;ConstructL();&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;CleanupStack::Pop(self);&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;return self;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CMyTimer::CMyTimer() : CActive(EPriorityStandard)&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Standard priority&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void CMyTimer::ConstructL()&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;User::LeaveIfError(iTimer.CreateLocal());&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Initialize timer&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTelephony=CTelephony::NewL();&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;CActiveScheduler::Add(this);&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Add to scheduler&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;CMyTimer::~CMyTimer()&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Cancel(); // Cancel any request, if outstanding&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Delete instance variables if any&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;delete iTelephony;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTimer.Close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void CMyTimer::DoCancel()&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTelephony-&amp;gt;CancelAsync(CTelephony::EGetPhoneIdCancel);&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTimer.Cancel();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void CMyTimer::StartL(TTimeIntervalMicroSeconds32 aDelay)&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Cancel();&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Cancel any request, just to be sure&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iState = EUninitialized;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTimer.After(iStatus, aDelay);&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Set for later&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;SetActive();&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Tell scheduler a request is active&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void CMyTimer::RunL()&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if(iStatus!=KErrNone)&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;TBuf&amp;lt;8&amp;gt; code;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;code.Num(iStatus.Int());&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;User::InfoPrint(code);// Never showed&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;if (iState == EUninitialized) &lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iState=EInitialized;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;CTelephony::TPhoneIdV1Pckg phoneIdPckg(iPhoneId);&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTelephony-&amp;gt;GetPhoneId(iStatus, phoneIdPckg);&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;SetActive();&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;else if (iState==EInitialized)&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;{&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iState=EUninitialized;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;User::InfoPrint(KText);&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;iTimer.After(iStatus, 5000000);&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;// Set for 5 sec later&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;SetActive();&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;When i lanch program first (iState==EInitialized){...} statement never is called.&lt;br /&gt;I exit from program and start it again. Then (iState==EInitialized){...} statement is called.&lt;br /&gt;Any ideas?&lt;/div&gt;</description>
 <pubDate>Fri, 12 Jan 2007 13:26:22 +0100</pubDate>
 <dc:creator>tyatya</dc:creator>
 <guid isPermaLink="false">comment 36825 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317#comment-36824</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;Hi&lt;br /&gt;&lt;br /&gt;What about your DoCancel() implementation? do you cancel pending requests?&lt;br /&gt;&lt;br /&gt;plz post also the error handling part in the RunL, that could be the reason.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description>
 <pubDate>Thu, 11 Jan 2007 16:23:40 +0100</pubDate>
 <dc:creator>Alcoran</dc:creator>
 <guid isPermaLink="false">comment 36824 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317#comment-36823</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;i&gt;While calling the StartL() you&amp;#039;ve set the iState to EUninitialized, so first time it will go to the if (iState == EUninitialized) in your RunL().&lt;/i&gt;&lt;br /&gt;But in second step State==EInitialized {...}statement should be called. But it is not called. &lt;img src=&quot;/en/sites/all/modules/smf_filter/smf_smileys/angry.gif&quot; alt=&quot;Angry&quot; border=&quot;0&quot; /&gt;&lt;br /&gt;&lt;i&gt;By the way it&amp;#039;s always checking the iStatus before checking your iState in RunL().&lt;/i&gt; Thanks. But i remove this statements from forum message for conciseness.&lt;/div&gt;</description>
 <pubDate>Thu, 11 Jan 2007 15:16:45 +0100</pubDate>
 <dc:creator>tyatya</dc:creator>
 <guid isPermaLink="false">comment 36823 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317#comment-36822</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;div class=&quot;quoteheader&quot;&gt;Quote from: tyatya&lt;/div&gt;&lt;div class=&quot;quote&quot;&gt;When i first call StartL(1000) from my UI-class command handler i never see KText in emul, i.e. iState==EInitialized {...}statement never call. &lt;br /&gt;But whet i call StartL(...) again from my UI-class command handler i see KText info.&lt;br /&gt;Where is a problem?&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;While calling the StartL() you&amp;#039;ve set the iState to EUninitialized, so first time it will go to the if (iState == EUninitialized) in your RunL(). By the way it&amp;#039;s always checking the iStatus before checking your iState in RunL().&lt;/div&gt;</description>
 <pubDate>Thu, 11 Jan 2007 15:01:34 +0100</pubDate>
 <dc:creator>vin2ktalks</dc:creator>
 <guid isPermaLink="false">comment 36822 at http://www.newlc.com</guid>
</item>
<item>
 <title>CTelephony and CActive problem</title>
 <link>http://www.newlc.com/en/topic-17317</link>
 <description>&lt;div class=&quot;smf-content&quot;&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/en/topic-17317&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/en/topic-17317#comments</comments>
 <category domain="http://www.newlc.com/en/forums/telephony">Telephony</category>
 <pubDate>Thu, 11 Jan 2007 14:35:10 +0100</pubDate>
 <dc:creator>tyatya</dc:creator>
 <guid isPermaLink="false">16857 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
