Couple questions from a newbie

Login to reply to this topic.
Tue, 2008-06-03 20:37
Joined: 2008-06-03
Forum posts: 12

1) What can cause CBitmapScaler->Scale not to return? I've got the following code:

// parameters already done
iScaler->Scale( &iStatus, *pic, newsize);

// write something to the screen (just testing)
gc.DrawText(str2, drawRect, baseline, CGraphicsContext::ELeft, margin);

// wait for the request
User::WaitForRequest(iStatus);

The WaitForRequest hangs and eventually causes a panic.

I know waiting for a request is frowned upon, but for right now I'd just like to be able to see the image change sizes so I know I'm using Scale properly.

2) Because WaitForRequest is not always an available option, can someone point me to a decent tutorial for active objects? I've looked through the code in the ImageConverterExample and have a basic idea of what's going on, but something with a step-by-step process for creating and using a handler would be great.

Thanks!


Wed, 2008-06-04 07:41
Joined: 2008-05-21
Forum posts: 15
Re: Couple questions from a newbie

u can know what the Panic message means in the link below:

http://www.symbian.com/developer/techlib/v70docs/SDL_v7.0/doc_source/reference/SystemPanics/ConePanics.html

have a look at it, it may help u.

gud luck,

Punit.

Wed, 2008-06-04 14:05
Joined: 2008-06-03
Forum posts: 12
Re: Couple questions from a newbie

Thanks. I know the panic is happening because the request is timing out. What I don't know is how to figure out why or how to fix it.

Fri, 2008-06-06 12:33
Joined: 2005-04-13
Forum posts: 120
Re: Couple questions from a newbie

The problem is occuring due to use of waitforrequest. And as you already said, that this problem can be minimized with the use of Active object, so please refer to SDK for active object's life cycle or search the net. you will surely get lots of material


Jupitar

Fri, 2008-06-06 17:24
Joined: 2007-09-23
Forum posts: 159
Re: Couple questions from a newbie

"I know the panic is happening because the request is timing out. What I don't know is how to figure out why or how to fix it."

How do you know this?

Even if it is timing out that shouldn't cause a panic. Find out what the panic code is.

"The problem is occuring due to use of waitforrequest."
How do you know without seeing any more of the code? Use of User::WatiFroRequest() in itself doesn't cause things to panic.

Is this code part of an active object and you are using that objects iStatus? If so your problem lies there, post the rest of your code.

  • Login to reply to this topic.