Advertisement

05.09.2008 at 10:32PM PDT, ID: 23391321 | Points: 125
[x]
Attachment Details

Program Terminates / Crashes on cleanupstack::PushL() statement

Tags: Symbian C++, Carbide C++
I just decided I wanted to create programs for my nokia phone which uses symbian third

So i was going though a tutorial" Wiley - S60.Programming.A.Tutorial.Guide.Apr.2007" which seems to have errors in their code.. but anyway..

when i entered this example and ran it it jus exited prematurely. No reason nothing (i'm familiar with visual basic coding so the lack of an error message is very disconcerting. I then proceeded to debug and step though the program and every time it reaches the statement "CleanupStack::PushL(self);" in the NewLC function it just exits. I tried taking out the cleanupstack statements and it runs fine.
I'm using Carbide.c++ v1.3 and i placed the debugger in the text mode

i attached the code a part of the main which calls the NewL which calls the NewLC which is where it fails at the cleanupstack::PushL(self2); statement
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
LOCAL_C void MainL()
	{
	//
	// add your program code here, example code below
	//
	CCards* deckOfCards = CCards::NewL();
	TInt i, card;
	for (i=0; i<15; i++)
 
 
--------------------------------------------------------
#include "cards.h"
CCards* CCards::NewL()
	{
	CCards* self = CCards::NewLC();
	CleanupStack::Pop(self);
	return(self);
	}
 
CCards* CCards::NewLC()
	{
	CCards* self2 = new (ELeave) CCards();
	self2->ConstructL();
	CleanupStack::PushL(self2);
	return(self2);
	}
 
void CCards::ConstructL()
	{
	}
 
CCards::CCards()
	{
	for (TInt i=0; i<52; i++)
		iDeck[i] = i;
	}
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: cpumaster_2000
Question Asked On: 05.09.2008
Participating Experts: 1
Points: 125
Views: 0
Translate:
Loading Advertisement...
05.10.2008 at 01:46AM PDT, ID: 21538256

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628