PDA

View Full Version : sysAppLaunch


gabragt
08-02-2005, 03:19 PM
Hi,

Im new to this forum...

I need some help with sysAppLaunch. I need to pass a string to the new application and Im using the cmdPBP argument.

Ive already done a lot of tests and concluded I must have misused MemPtr's and its functions. Theres the respective part of the file:

str= MemPtrNew (9);
MemSet (str, 8, (unsigned char) "casa.png");
MemPtrSetOwner (str, 0);

When I debug my project, I get a bus error and it shows as str value that "Register not available". Could you help me?

Thx for ur attention,
Gabriel

PS.: I think I sent wrongly this message to someone. Pls forgive me if i sent it to you...

CliePet
08-05-2005, 10:45 AM
First problem: you don't want MemSet, you want "MemMove" or even better "StrCopy".
StrCopy(str, "casa.png");

> MemSet (str, 8, (unsigned char) "casa.png");
FWIW: Sets the first 8 bytes in the buffer to the same unpredicatable number (the lower 8 bits of the address of the static string "casa.png")
The 9th byte is not set [ie. the string is likely not zero terminated]
The need for the cast should have been a red flag not to do that.

gabragt
08-10-2005, 10:23 AM
Thank you CliePet for your answer. Ive tried integrating the 2 programs cause that way I didnt need to use the code above and it worked .
Anyways, if I need to use program launching again I know now where I was mistaken.