RVCT question | developer.brewmp.com RVCT question | developer.brewmp.com

Developer

RVCT question

Hi I am trying to compile my applets and actors using RVCT 2.1, but I keep on getting errors when it encounters LIT in cpp files. My question is, is RVCT 2.1 compatible for compiling BREW c++ files? What is the difference between ADS and RVCT? Should I use ADS instead of RVCT? Thanks.

SimonE wrote:Hi I am trying to compile my applets and actors using RVCT 2.1, but I keep on getting errors when it encounters LIT in cpp files. My question is, is RVCT 2.1 compatible for compiling BREW c++ files? What is the difference between ADS and RVCT? Should I use ADS instead of RVCT? Thanks.
You might be getting the following error:
'initializing' : cannot convert from 'const wchar_t [12]' to 'const AECHAR [12]'
If this is the case then change your project settings.
Project/Properties/ConfigurationProperties/C or C++/Language/Treat wchat_t as Built-in Type select this as No
This may help your problem.

SimonE wrote:Hi I am trying to compile my applets and actors using RVCT 2.1, but I keep on getting errors when it encounters LIT in cpp files. My question is, is RVCT 2.1 compatible for compiling BREW c++ files? What is the difference between ADS and RVCT? Should I use ADS instead of RVCT? Thanks.
You might be getting the following error:
'initializing' : cannot convert from 'const wchar_t [12]' to 'const AECHAR [12]'
If this is the case then change your project settings.
Project/Properties/ConfigurationProperties/C or C++/Language/Treat wchat_t as Built-in Type select this as No
This may help your problem.

Useful tip abhimanyu, but only for simulator compilation on Visual Studio, not RVCT!!
The problem is that wchar_t is a standard type in C++ (but not C), and the compiler won't cast between wchar_t and AECHAR. If you go edit AEEComDef.h and change typedef uint16 AECHAR to
#ifdef __cplusplus
typedef wchar_t AECHAR
#else
typedef uint16 AECHAR
#endif
then it should work fine. However, I think you have bigger problems:
http://www.arm.com/support/faqdev/14109.html
So yes, if you've got ADS use that.

Useful tip abhimanyu, but only for simulator compilation on Visual Studio, not RVCT!!
The problem is that wchar_t is a standard type in C++ (but not C), and the compiler won't cast between wchar_t and AECHAR. If you go edit AEEComDef.h and change typedef uint16 AECHAR to
#ifdef __cplusplus
typedef wchar_t AECHAR
#else
typedef uint16 AECHAR
#endif
then it should work fine. However, I think you have bigger problems:
http://www.arm.com/support/faqdev/14109.html
So yes, if you've got ADS use that.

Ben's point about PI is definitely valid, however, as of last year and the release of elf2mod utility by Qualcomm, it is now possible to use RVCT 2.2 and even better, RVDS 3.0 for BREW.
Again, this isn't natively supported as Ben pointed out, but it is now possible and highly useful for advanced programming constructs.
Link to elf2mod announcement
Our CTO is actually speaking at the BREW conference in June concerning the use of RVDS 3 and the opportunities that it provides in its full C++ support. The talk is entitled 'Template Meta Programming in BREW – Increasing Development Efficiency' and will be on Thursday @ 2:45 in the Manchester C room.
Conference Schedule
Hope to see you all there.

Ben's point about PI is definitely valid, however, as of last year and the release of elf2mod utility by Qualcomm, it is now possible to use RVCT 2.2 and even better, RVDS 3.0 for BREW.
Again, this isn't natively supported as Ben pointed out, but it is now possible and highly useful for advanced programming constructs.
Link to elf2mod announcement
Our CTO is actually speaking at the BREW conference in June concerning the use of RVDS 3 and the opportunities that it provides in its full C++ support. The talk is entitled 'Template Meta Programming in BREW – Increasing Development Efficiency' and will be on Thursday @ 2:45 in the Manchester C room.
Conference Schedule
Hope to see you all there.

Ah, that's interesting. I hadn't twigged that elf2mod would solve that problem too, but of course it does - and then 3.0 is a better compiler all round. Namespaces, exceptions, and better template support for a start...
I'll try to get to your talk! Our CTO (err, that's me) will be speaking on Real Life Porting and Coding on BREW, Friday @ 13:45 in Randle A.

Ah, that's interesting. I hadn't twigged that elf2mod would solve that problem too, but of course it does - and then 3.0 is a better compiler all round. Namespaces, exceptions, and better template support for a start...
I'll try to get to your talk! Our CTO (err, that's me) will be speaking on Real Life Porting and Coding on BREW, Friday @ 13:45 in Randle A.

thank you for your replies.
I've done the solution of changing AECHAR and yes it works, but since there are other problems.
I've used ADS for actors. Problem now is that I am stuck with a link error pointing to 4 byte and 8 byte stack alignment when libraries built in ADS are linked with my environment which is built in RVCT. I've tried using -apcs /adsabi tag with building my enviroment but there are libraries without source code which cannot be rebult.
I tried to create mod files as another option, but it takes too much time in including all the paths needed by to sucessfully create mod files.
Is there a build option tag that can be used to link the environment built with RVCT and libraries built with ADS? Also, is there a way to include a file with all the include paths to a make mod batch file?
Thank you.

thank you for your replies.
I've done the solution of changing AECHAR and yes it works, but since there are other problems.
I've used ADS for actors. Problem now is that I am stuck with a link error pointing to 4 byte and 8 byte stack alignment when libraries built in ADS are linked with my environment which is built in RVCT. I've tried using -apcs /adsabi tag with building my enviroment but there are libraries without source code which cannot be rebult.
I tried to create mod files as another option, but it takes too much time in including all the paths needed by to sucessfully create mod files.
Is there a build option tag that can be used to link the environment built with RVCT and libraries built with ADS? Also, is there a way to include a file with all the include paths to a make mod batch file?
Thank you.

Can your CTO throw in a comparison with WINARM with regard to template and exception support?
:D
ZeroCool wrote:Ben's point about PI is definitely valid, however, as of last year and the release of elf2mod utility by Qualcomm, it is now possible to use RVCT 2.2 and even better, RVDS 3.0 for BREW.
Again, this isn't natively supported as Ben pointed out, but it is now possible and highly useful for advanced programming constructs.
Link to elf2mod announcement
Our CTO is actually speaking at the BREW conference in June concerning the use of RVDS 3 and the opportunities that it provides in its full C++ support. The talk is entitled 'Template Meta Programming in BREW – Increasing Development Efficiency' and will be on Thursday @ 2:45 in the Manchester C room.
Conference Schedule
Hope to see you all there.

Can your CTO throw in a comparison with WINARM with regard to template and exception support?
:D
ZeroCool wrote:Ben's point about PI is definitely valid, however, as of last year and the release of elf2mod utility by Qualcomm, it is now possible to use RVCT 2.2 and even better, RVDS 3.0 for BREW.
Again, this isn't natively supported as Ben pointed out, but it is now possible and highly useful for advanced programming constructs.
Link to elf2mod announcement
Our CTO is actually speaking at the BREW conference in June concerning the use of RVDS 3 and the opportunities that it provides in its full C++ support. The talk is entitled 'Template Meta Programming in BREW – Increasing Development Efficiency' and will be on Thursday @ 2:45 in the Manchester C room.
Conference Schedule
Hope to see you all there.

basically v3c supports ads1.2 version compiler but i have rvct arm compiler and gnu compiler which im using to create mod file and loading to device is there any considerable diff bw rvct and ads1.2 which might help me in running my appl on device successfully witout appl gtting crashed
as of nw my appl is not stable its behaving abnormally in device it often gets crashed not at one place, im unable to fx da error, can u suggest me some kind of tool which i can ise to debug my code on device....
regards
manju

basically v3c supports ads1.2 version compiler but i have rvct arm compiler and gnu compiler which im using to create mod file and loading to device is there any considerable diff bw rvct and ads1.2 which might help me in running my appl on device successfully witout appl gtting crashed
as of nw my appl is not stable its behaving abnormally in device it often gets crashed not at one place, im unable to fx da error, can u suggest me some kind of tool which i can ise to debug my code on device....
regards
manju

JTAG for on device debugging., there is/was a gdb extension but i've never used it.
Its usually unlikely a compiler switch makes a program run better, errors just might get hidden.
You'd be better off running it either in the emulator or a native win32 version using all the different development tools available for win32, the only things you lose out on there is actually device bugs, but it will help determine if the code is solid.

JTAG for on device debugging., there is/was a gdb extension but i've never used it.
Its usually unlikely a compiler switch makes a program run better, errors just might get hidden.
You'd be better off running it either in the emulator or a native win32 version using all the different development tools available for win32, the only things you lose out on there is actually device bugs, but it will help determine if the code is solid.

charliex wrote:JTAG for on device debugging., there is/was a gdb extension but i've never used it.
Its usually unlikely a compiler switch makes a program run better, errors just might get hidden.
You'd be better off running it either in the emulator or a native win32 version using all the different development tools available for win32, the only things you lose out on there is actually device bugs, but it will help determine if the code is solid.
thanks for jtag suggestion, can u give me da link wher from i can get dat...
i have posted ma code below in one of da line my application gets crashed,
if you can say any considerable change which i have to make it wil help me...
basically da below code works good for 6-8 http post req fine but afterwards my application hangs whenever i try to read in data from server
static void WebReadCB_poll(void* cxt)
{
mitocs* pMe = mitocs* cxt;
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in WebReadCB_poll", MAKE_RGB(233, 128, 61));
DBGPRINTF("in WebReadCB_poll");
pMe->pWebRespInfo_poll = IWEBRESP_GetInfo(pMe->m_pIWebResp_poll);
if (pMe->pWebRespInfo_poll)
{
if (!WEB_ERROR_SUCCEEDED(pMe->pWebRespInfo_poll->nCode))
{
pMe->response_success_poll = FALSE;
}
else
{
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in else", MAKE_RGB(233, 128, 61));
DBGPRINTF("in else");
pMe->m_pISource_poll = pMe->pWebRespInfo_poll->pisMessage;
if(pMe->m_pISource_poll!=NULL)
ReadFromWebCB_poll(pMe);
return;
}
if (!pMe->response_success_poll)
{
WebCleanup_poll(pMe);
http_webrequest_poll(pMe);
}
}

void ReadFromWebCB_poll(mitocs *pMe)
{
int ByteCount;//,i,c;
char* buf=NULL;
long buf_len;
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in ReadFromWebCB_poll", MAKE_RGB(233, 128, 61));
DBGPRINTF("in ReadFromWebCB_poll");
pMe->poll=TRUE;
buf_len=pMe->pWebRespInfo_poll->lContentLength;
if(buf_len != -1)
{
buf=(char *) MALLOC (buf_len);
ByteCount = ISOURCE_Read(pMe->m_pISource_poll,buf,buf_len);
switch (ByteCount)
{
case ISOURCE_WAIT:
ISOURCE_Readable(pMe->m_pISource_poll, &pMe->m_Callback_poll);
return;
case ISOURCE_ERROR:
pMe->response_success_poll = FALSE;
break;
case ISOURCE_END:
break;
default:
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in default", MAKE_RGB(233, 128, 61));
DBGPRINTF("in default");
pMe->response_success_poll = TRUE;
if (ByteCount)
{
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in byte count", MAKE_RGB(233, 128, 61));
DBGPRINTF("in byte count");
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll + pMe->m_BodySize_poll, buf, ByteCount);
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"after copy 2 buf", MAKE_RGB(233, 128, 61));
DBGPRINTF("after copy 2 buf");
polling_response(pMe);
DBGPRINTF("after polling response");
}
break;
}
}
else
pMe->response_success_poll = TRUE;
DBGPRINTF("bfore cleanup");
WebCleanup_poll(pMe);
DBGPRINTF("after cleanup");
if (!pMe->response_success_poll)
{
http_webrequest_poll(pMe);
}
if (pMe->response_success_poll && pMe->prev_fun_id_pool==23)
{
polling(pMe);
}
else if (pMe->response_success_poll && pMe->prev_fun_id_pool==22)
{
PresenceNotif_Res(pMe,pMe->ret_mesg);
}
else if (pMe->response_success_poll && pMe->prev_fun_id_pool==21)
{
delivery_rep(pMe,pMe->ret_mesg);
}
else if (pMe->response_success_poll && pMe->prev_fun_id_pool==24)
{
presence_auth_resp(pMe);
}
if(buf_len != -1)
{
FREE(buf);
}

void WebCleanup_poll(mitocs* pMe)
{
DBGPRINTF("in cleanup");
CALLBACK_Cancel(&pMe->m_Callback_poll);
if (pMe->m_pIWebResp_poll)
{
IWEBRESP_Release(pMe->m_pIWebResp_poll);
pMe->m_pIWebResp_poll = NULL;
}
if (pMe->m_pIWeb_poll)
{
IWEB_Release(pMe->m_pIWeb_poll);
pMe->m_pIWeb_poll = NULL;
}
if (pMe->m_BodyBuffer_poll)
{
FREE(pMe->m_BodyBuffer_poll);
pMe->m_BodyBuffer_poll = NULL;
}
pMe->m_BodySize_poll = 0;
DBGPRINTF("end clean up");
// pMe->m_BodyAllocSize_poll = 0;

charliex wrote:JTAG for on device debugging., there is/was a gdb extension but i've never used it.
Its usually unlikely a compiler switch makes a program run better, errors just might get hidden.
You'd be better off running it either in the emulator or a native win32 version using all the different development tools available for win32, the only things you lose out on there is actually device bugs, but it will help determine if the code is solid.
thanks for jtag suggestion, can u give me da link wher from i can get dat...
i have posted ma code below in one of da line my application gets crashed,
if you can say any considerable change which i have to make it wil help me...
basically da below code works good for 6-8 http post req fine but afterwards my application hangs whenever i try to read in data from server
static void WebReadCB_poll(void* cxt)
{
mitocs* pMe = mitocs* cxt;
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in WebReadCB_poll", MAKE_RGB(233, 128, 61));
DBGPRINTF("in WebReadCB_poll");
pMe->pWebRespInfo_poll = IWEBRESP_GetInfo(pMe->m_pIWebResp_poll);
if (pMe->pWebRespInfo_poll)
{
if (!WEB_ERROR_SUCCEEDED(pMe->pWebRespInfo_poll->nCode))
{
pMe->response_success_poll = FALSE;
}
else
{
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in else", MAKE_RGB(233, 128, 61));
DBGPRINTF("in else");
pMe->m_pISource_poll = pMe->pWebRespInfo_poll->pisMessage;
if(pMe->m_pISource_poll!=NULL)
ReadFromWebCB_poll(pMe);
return;
}
if (!pMe->response_success_poll)
{
WebCleanup_poll(pMe);
http_webrequest_poll(pMe);
}
}

void ReadFromWebCB_poll(mitocs *pMe)
{
int ByteCount;//,i,c;
char* buf=NULL;
long buf_len;
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in ReadFromWebCB_poll", MAKE_RGB(233, 128, 61));
DBGPRINTF("in ReadFromWebCB_poll");
pMe->poll=TRUE;
buf_len=pMe->pWebRespInfo_poll->lContentLength;
if(buf_len != -1)
{
buf=(char *) MALLOC (buf_len);
ByteCount = ISOURCE_Read(pMe->m_pISource_poll,buf,buf_len);
switch (ByteCount)
{
case ISOURCE_WAIT:
ISOURCE_Readable(pMe->m_pISource_poll, &pMe->m_Callback_poll);
return;
case ISOURCE_ERROR:
pMe->response_success_poll = FALSE;
break;
case ISOURCE_END:
break;
default:
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in default", MAKE_RGB(233, 128, 61));
DBGPRINTF("in default");
pMe->response_success_poll = TRUE;
if (ByteCount)
{
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"in byte count", MAKE_RGB(233, 128, 61));
DBGPRINTF("in byte count");
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll + pMe->m_BodySize_poll, buf, ByteCount);
IDISPLAY_ClearScreen (pMe->a.m_pIDisplay);
DisplayOutput((IApplet *)pMe,9,"after copy 2 buf", MAKE_RGB(233, 128, 61));
DBGPRINTF("after copy 2 buf");
polling_response(pMe);
DBGPRINTF("after polling response");
}
break;
}
}
else
pMe->response_success_poll = TRUE;
DBGPRINTF("bfore cleanup");
WebCleanup_poll(pMe);
DBGPRINTF("after cleanup");
if (!pMe->response_success_poll)
{
http_webrequest_poll(pMe);
}
if (pMe->response_success_poll && pMe->prev_fun_id_pool==23)
{
polling(pMe);
}
else if (pMe->response_success_poll && pMe->prev_fun_id_pool==22)
{
PresenceNotif_Res(pMe,pMe->ret_mesg);
}
else if (pMe->response_success_poll && pMe->prev_fun_id_pool==21)
{
delivery_rep(pMe,pMe->ret_mesg);
}
else if (pMe->response_success_poll && pMe->prev_fun_id_pool==24)
{
presence_auth_resp(pMe);
}
if(buf_len != -1)
{
FREE(buf);
}

void WebCleanup_poll(mitocs* pMe)
{
DBGPRINTF("in cleanup");
CALLBACK_Cancel(&pMe->m_Callback_poll);
if (pMe->m_pIWebResp_poll)
{
IWEBRESP_Release(pMe->m_pIWebResp_poll);
pMe->m_pIWebResp_poll = NULL;
}
if (pMe->m_pIWeb_poll)
{
IWEB_Release(pMe->m_pIWeb_poll);
pMe->m_pIWeb_poll = NULL;
}
if (pMe->m_BodyBuffer_poll)
{
FREE(pMe->m_BodyBuffer_poll);
pMe->m_BodyBuffer_poll = NULL;
}
pMe->m_BodySize_poll = 0;
DBGPRINTF("end clean up");
// pMe->m_BodyAllocSize_poll = 0;

use [ code ] tags for posting code, makes it easier to read
giving it a quick scan, whats going on here? is m_BodySize_poll always zero ?
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll + pMe->m_BodySize_poll, buf, ByteCount);
jtag
http://www.lauterbach.com/frames.html

use [ code ] tags for posting code, makes it easier to read
giving it a quick scan, whats going on here? is m_BodySize_poll always zero ?
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll + pMe->m_BodySize_poll, buf, ByteCount);
jtag
http://www.lauterbach.com/frames.html

charliex wrote:use [ code ] tags for posting code, makes it easier to read
giving it a quick scan, whats going on here? is m_BodySize_poll always zero ?
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll + pMe->m_BodySize_poll, buf, ByteCount);
jtag
http://www.lauterbach.com/frames.html
sorry for da way i had posted da query.
it is actually a mistake which i was doing, there is no necessary to use pMe->m_BodySize_poll.
nw im reading content lenth from header and allocating memory dynamically
for da buffer and copying it, but still ma application crashes on device. it works perfectly on emulator,on device im facing problems, unable to fix da problem as i heve no tool 2 find where da problem lies
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll, buf, ByteCount);
i have atttached ma code which im loading on motorola v3c device..
if u can tell me da mistake wht me doing it will be grt help

charliex wrote:use [ code ] tags for posting code, makes it easier to read
giving it a quick scan, whats going on here? is m_BodySize_poll always zero ?
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll + pMe->m_BodySize_poll, buf, ByteCount);
jtag
http://www.lauterbach.com/frames.html
sorry for da way i had posted da query.
it is actually a mistake which i was doing, there is no necessary to use pMe->m_BodySize_poll.
nw im reading content lenth from header and allocating memory dynamically
for da buffer and copying it, but still ma application crashes on device. it works perfectly on emulator,on device im facing problems, unable to fix da problem as i heve no tool 2 find where da problem lies
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll, buf, ByteCount);
i have atttached ma code which im loading on motorola v3c device..
if u can tell me da mistake wht me doing it will be grt help

QUOTE=charliex]use [ code ] tags for posting code, makes it easier to read
giving it a quick scan, whats going on here? is m_BodySize_poll always zero ?
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll + pMe->m_BodySize_poll, buf, ByteCount);
jtag
http://www.lauterbach.com/frames.html
sorry for da way i had posted da query.
it is actually a mistake which i was doing, there is no necessary to use pMe->m_BodySize_poll.
nw im reading content lenth from header and allocating memory dynamically
for da buffer and copying it, but still ma application crashes on device. it works perfectly on emulator,on device im facing problems, unable to fix da problem as i heve no tool 2 find where da problem lies
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll, buf, ByteCount);
i have atttached ma code which im loading on motorola v3c device..
if u can tell me da mistake wht me doing it will be grt help

QUOTE=charliex]use [ code ] tags for posting code, makes it easier to read
giving it a quick scan, whats going on here? is m_BodySize_poll always zero ?
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll + pMe->m_BodySize_poll, buf, ByteCount);
jtag
http://www.lauterbach.com/frames.html
sorry for da way i had posted da query.
it is actually a mistake which i was doing, there is no necessary to use pMe->m_BodySize_poll.
nw im reading content lenth from header and allocating memory dynamically
for da buffer and copying it, but still ma application crashes on device. it works perfectly on emulator,on device im facing problems, unable to fix da problem as i heve no tool 2 find where da problem lies
pMe->m_BodyBuffer_poll=(char *) MALLOC (ByteCount);
MEMCPY(pMe->m_BodyBuffer_poll, buf, ByteCount);
i have atttached ma code which im loading on motorola v3c device..
if u can tell me da mistake wht me doing it will be grt help

I'd start by adding some error checking, asserts and going over your memory allocation/deallocation, without seeing the whole program its difficult to say what you're upto with some of the variables.
Use snprintf instead of strcpy/strcats then you can at least make sure you're not buffer overruning, although its unlikey you're hitting a 600 byte limit, but mainly you're simplifying debugging and code flow.
initialise variables to 0, make sure freshly allocated memory is zero'd if you expect it to be, make sure callbacks are reentrant if they need to be.
Could be a bug in the phone, memory problems, or unitialised data/variables, VC should catch them in debug mode, try using bounds checker too, but get used to adding error checking, especially asserts, they'll go away in release mode so it won't add to the code size and it will help you later on.
watch out for things like
if(pointer)
free(pointer;
pointer=malloc(...) ;
if you don't initialise pointer to null to start off with, its possible you end up freeing a bad pointer, some OS's also have problems freeing NULL pointers even though its valid C.
I usually wrap malloc and add asserts on the size, and if it succeded, as well as trrack the memory allocated, add overrrun/underrun checks then add a function that checks the integrity of the list.
also if you can change the heap type in the qsc file to use windows heap, it'll often catch memory problems the internal brew heap won't ( i only use the 2.1 simulator i'm not sure if 3.x still has it)
also you might get away with using afx.h and _DEBUG to get the MFC style memory debugging, you may need other defines, look up DEBUG_NEW
put on maximum level error /warning settings on both compilers, and check all the warnings.
globals requring fixups can also cause crashes on the phone, where you'll get away with it on the simulator and even on some phones, again less likely since your problem isn't first time run crash.
this just a general list of things to help debugging and robustness, your problem may lie elsewhere, if you really can't find it then the best thing to do is create the smallest possible test case that shows the crash, zip up everything required to build it, then list out which phone, firmware, SDK version and how to reproduce it, and maybe someone will look at it, large blocks of partial code isn't always that helpful since most of us know that the answer might lie elsewhere so less people are going to look at it.

I'd start by adding some error checking, asserts and going over your memory allocation/deallocation, without seeing the whole program its difficult to say what you're upto with some of the variables.
Use snprintf instead of strcpy/strcats then you can at least make sure you're not buffer overruning, although its unlikey you're hitting a 600 byte limit, but mainly you're simplifying debugging and code flow.
initialise variables to 0, make sure freshly allocated memory is zero'd if you expect it to be, make sure callbacks are reentrant if they need to be.
Could be a bug in the phone, memory problems, or unitialised data/variables, VC should catch them in debug mode, try using bounds checker too, but get used to adding error checking, especially asserts, they'll go away in release mode so it won't add to the code size and it will help you later on.
watch out for things like
if(pointer)
free(pointer;
pointer=malloc(...) ;
if you don't initialise pointer to null to start off with, its possible you end up freeing a bad pointer, some OS's also have problems freeing NULL pointers even though its valid C.
I usually wrap malloc and add asserts on the size, and if it succeded, as well as trrack the memory allocated, add overrrun/underrun checks then add a function that checks the integrity of the list.
also if you can change the heap type in the qsc file to use windows heap, it'll often catch memory problems the internal brew heap won't ( i only use the 2.1 simulator i'm not sure if 3.x still has it)
also you might get away with using afx.h and _DEBUG to get the MFC style memory debugging, you may need other defines, look up DEBUG_NEW
put on maximum level error /warning settings on both compilers, and check all the warnings.
globals requring fixups can also cause crashes on the phone, where you'll get away with it on the simulator and even on some phones, again less likely since your problem isn't first time run crash.
this just a general list of things to help debugging and robustness, your problem may lie elsewhere, if you really can't find it then the best thing to do is create the smallest possible test case that shows the crash, zip up everything required to build it, then list out which phone, firmware, SDK version and how to reproduce it, and maybe someone will look at it, large blocks of partial code isn't always that helpful since most of us know that the answer might lie elsewhere so less people are going to look at it.

Thanks for your so much help.. i am greatful for the valid points you gave me.
now i have cleared most of da bugs as u suggested, but now i'm facing problem
in the below concept..
in ma application two process runs simultaneously.second proccess starts with sme delay after my first process kicks off, and it runs contineously in background if i do some action in front ground or at dat time if my first process starts executing
my application gets crashes on device..
basically i can say da problem is two proccess simultaneously at a time not happening....
since i am not implimenting threads,i want my first process to stop when second starts and again resume when second ends...
thanks,
manju.

Thanks for your so much help.. i am greatful for the valid points you gave me.
now i have cleared most of da bugs as u suggested, but now i'm facing problem
in the below concept..
in ma application two process runs simultaneously.second proccess starts with sme delay after my first process kicks off, and it runs contineously in background if i do some action in front ground or at dat time if my first process starts executing
my application gets crashes on device..
basically i can say da problem is two proccess simultaneously at a time not happening....
since i am not implimenting threads,i want my first process to stop when second starts and again resume when second ends...
thanks,
manju.