I've successfully used SysAppLaunch and customized launch codes to pass
DWords back and forth, but I'm having a few conceptual problems getting my
mind around how to make it work to pass structures around.

For instance, if I have:

typedef struct
{
  Char name[40];
  Int value;
} testtype;

I can do something like this in the calling application:
testtype *returnvp;
Err err;
LocalID dbID;

dbID = DmFindDatabase(0, "Application");
returnvp = MemPtrNew (sizeof(testtype));
if (dbID) {
  err = SysAppLaunch (0, dbID, 0, 32768, 0, (DWord *) test);
}


And something like this in the returning app:
testtype *test;
if (cmd == 32768) {
  test = MemPtrNew (sizeof(testtype));
  StrCopy (test->name, "Bob");
  test->value = 5;
  return ((DWord)test);
}

While it builds fine, and I can test that the app launches fine (I can put a
WinDrawChars in the above code), I can't get the correct values out of the
app that launches this. However, if I simply use DWord's instead, all works
fine...Obviously I'm doing something silly, can someone point it out to me.
Thanks.





Reply via email to