<< 1. The XCMD / DLL must be substantially larger than 32K. So, at least
for Macintosh, I have to create an XCMD that loads the larger block of
code into memory and then calls it. Also, perhaps it is best to leave
the loaded code resident in memory until MetaCard quits (or my MetaCard
stack closes), because the XCMD / DLL will be called repeatedly. >>
You don't necessarily have to keep the XCMD under 32k, if you can afford to
be PPC-only. I've had much larger XCMDs before, and they work fine. I'm not
sure what Metacard's policy is as far as keeping XCMDs in memory however-
it's my feeling that they will stick around if you have sufficient memory
allocated, but someone more in the know would have to to answer that one for
sure.
<<2. The XCMD / DLL must allocate large amounts of memory (several MB), to
be maintained even when the XCMD / DLL is not in use, and de-allocated
when MetaCard quits. I have done this previously on the Mac, but I
haven't learned how to do this on PCs.>>
What about just malloc() - ing the memory in your XCMD/DLL, and saving the
pointer to a Metacard global? Then add de-allocating code to your XCMD/DLL's
cleanup routine which fetches those values and releases them.
<<3. The XCMD / DLL must set global variables in MetaCard, and ideally
could make other callbacks to MetaCard. >>
For XCMDs, Metacard support the standard XCMD SetGlobal/GetGlobal callbacks,
and for DLLs you can find the whole list of callbacks in the file
"XCmdGlue.h" in the folder "MC External Data" that comes with the Metacard
distribution. There is sample code in the file "external.c"... see the
"XCcallbacktests" function. It makes a variety of callbacks.
HTH,
Brian
This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm