I want to pass the "James" string to getTestString function, the first
time, the string could return "This is James" without any error.
Subsequently after the button is click, the application will just
hang/crash (grey out), it seem there some bugs in this code?
Screenshot: http://imagetwist.com/7896zupwtu97/a.jpg.html
Code:
FREObject getTestString(FREContext ctx, void* funcData, uint32_t argc,
FREObject argv[]) {
FREObject result;
//Temporary values to hold our actionscript code.
uint32_t albumLength;
const uint8_t *str;
uint8_t *strAll;
//Turn our actionscrpt code into native code.
FREGetObjectAsUTF8(argv[0], &albumLength, &str);
strcpy(strAll,"This is ");
strcat(strAll,str); //str is "James"
//const char *str = "this is ";
FRENewObjectFromUTF8(strlen(strAll)+1, (uint8_t *)strAll,
&result); //UTF8 to object and return
return result;
}
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
0 comments:
Post a Comment