CDesC8Array panic

Login to reply to this topic.
Fri, 2005-04-29 03:45
Joined: 2004-08-25
Forum posts: 32
Hi all,

I have implemented a Description Array. But everytime when I try to append a description to the new array, it will result a KERN-EXEC: 3 error. I have no idea about how to solve this. Could anyone help? Thanks!

Following is my code:
CDesC8Array* iParamArray;
iParamArray->AppendL(_L8("test\r\n"));

Thanks,
Vincent

Fri, 2005-04-29 04:43
Joined: 2004-01-09
Forum posts: 188
CDesC8Array panic
I am sorry, but u can't just Append anything to array unless u allocate any memory to it. See you are not allocating memory to your iParamArray variable. And your are trying to access the variable which does not exist in memory. That's why it is giving Kern-Exec 3. You should always first allocate memory to your pointer variables than only than you can use tham.

BR
Chetan

----
Chetan Kulshrestha

Fri, 2005-04-29 04:47
Joined: 2004-08-25
Forum posts: 32
CDesC8Array panic
Thanks for you reply! Chetan.

Could you tell me how can I allocate memory to it?

Thanks,
Vincent
Fri, 2005-04-29 04:54
Joined: 2005-04-28
Forum posts: 10
CDesC8Array panic
Hi cmc,

It is very simple you can allocate the memeory like this.
CDesC8Array* iParamArray = new (ELeave) CDesC8Array().


Regards
Chetana patil
Fri, 2005-04-29 05:04
Joined: 2004-01-09
Forum posts: 188
CDesC8Array panic
See CDesC8Array is an implementation base class for 8 bit descriptor arrays, better you use CDesC8ArrayFlat. CDesC8ArrayFlat is a descriptor array class implemented using a flat buffer. you can allocate it like this

CDesC8ArrayFlat* iParamArray = new (ELeave) CDesC8ArrayFlat(size_of_Array ).

BR
Chetan

----
Chetan Kulshrestha

Fri, 2005-04-29 05:04
Joined: 2004-08-25
Forum posts: 32
CDesC8Array panic
Hi Chetana,

It returns an error:
error C2512: 'CDesC8Array' : no appropriate default constructor available

How can I solve this?

Thanks,
Vincent
Fri, 2005-04-29 05:11
Joined: 2005-04-15
Forum posts: 18
CDesC8Array panic
Hi cmc100,
The class CDesC8Array is an abstract class and you cannot instantiate the class.

You can use CDesC8ArrayFlat which is actually derived from CDesC8Array.
Fri, 2005-04-29 05:27
Joined: 2004-08-25
Forum posts: 32
CDesC8Array panic
Thanks all of you!

I get it works now using CDesC8ArrayFlat.

Really Thanks!
  • Login to reply to this topic.