application crashing on CActive
Login to reply to this topic.
Thu, 2005-05-05 10:50
Joined: 2005-03-11
Forum posts: 38
#include <INetAsync.h>
#include <PageFetcher.h>


INetAsync::INetAsync() : CActive(EPriorityStandard) // Standard Priority
{
}


INetAsync* INetAsync::NewLC()
{
   INetAsync* self = new (ELeave) INetAsync();
   CleanupStack::PushL(self);
   self->ConstructL();
   
   return self;
}

INetAsync* INetAsync::NewL()
{
   INetAsync* self = NewLC();
   CleanupStack::Pop();
   
   return self;
}

void INetAsync::ConstructL()
{
   CActiveScheduler::Add(this);
}

INetAsync::~INetAsync()
{
   CActive::Cancel();
}

void INetAsync::DoCancel()
{
   
}

void INetAsync::IssueRequest(const wchar_t* url)
{
   CPageFetcher objPF;
   //objPF.StartRequest(url);
}

void INetAsync::RunL()
{
   // DO the finished work here
}

My code is crashing in constructl while executing CActiveScheduler::Add(this). Please tell the reason, its urgent. I am not passing null object, neither calling Add more than once. I am getting a run time error User breakpoint called from code at 0x6001c966

A simple symbian enthusiast


Thu, 2005-05-05 11:21
Joined: 2004-06-06
Forum posts: 205
what panic you get? if you get panic in ConstructL when you add your AO and you use this code in exe so maby you forgot to create a AS.

Best regards,
Michal Laskowski

Thu, 2005-05-05 11:50
Joined: 2005-03-11
Forum posts: 38
where should I create an AS ? Active scheduler, right ? and how ?

A simple symbian enthusiast

Thu, 2005-05-05 11:51
Joined: 2004-06-06
Forum posts: 205
are you building to exe?

Best regards,
Michal Laskowski

Thu, 2005-05-05 12:24
Joined: 2005-03-11
Forum posts: 38
No, I am building into a Dll and calling that Dll from a test exe application commandline for wins emulator

A simple symbian enthusiast

Thu, 2005-05-05 12:29
Joined: 2004-06-06
Forum posts: 205
so IMHO you should create AS in exe.
You should read bout AS in sdk docs.

Initialization of AS
Code:
CActiveScheduler * myAS = new( ELeave )CActiveScheduler;
CActiveScheduler::Install( myAS  );

Deinitialization of AS
Code:
CActiveScheduler::Install( NULL );
delete myAS;

Best regards,
Michal Laskowski

Fri, 2005-05-06 14:48
Joined: 2005-03-11
Forum posts: 38
Thanks a lot ! Excellent solution.

Thanks again

A simple symbian enthusiast


copyright 2003-2009 NewLC SARL