Callbacks

2000-03-13 Thread Jacqueline Landman Gay

When I set the callbacks for a player object, they work the first time
through the movie. After that they don't trigger on subsequent plays
unless I specifically "set" them again, even though when I query the
player it says they are still there. It looks like the property stays
set, but only works once. I can catch "mouseUp" and reset the property
each time, but it doesn't seem like it should be necessary. How is it
supposed to work?

Also, after a few repetitions, the controller stops working. The movie
plays through normally, but the controller doesn't move when you click
the start arrow, and you can't move it with the mouse. It doesn't look
like a memory problem, since the heapspace reports over 4 megs of free RAM.

-- 
Jacqueline Landman Gay| [EMAIL PROTECTED]
HyperActive Software  |   [EMAIL PROTECTED]
Custom hypermedia solutions   | http://www.hyperactivesw.com
612.724.1596  |   612.724.1562 - fax


Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to [EMAIL PROTECTED], not this list.



How to create large XCMD / DLL with callbacks

2000-02-28 Thread Ken Simons

I need to create an XCMD and DLL with several tricky characteristics. 
While I have created Macintosh XCMDs before, I am not sure how to deal
with this set of characteristics.  Also I have not dealt with DLLs for
PCs so I am unaware of issues that may arise.  Any insights or
references to code that does the job would be much appreciated.  

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.
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.
3. The XCMD / DLL must set global variables in MetaCard, and ideally
could make other callbacks to MetaCard.

CodeWarrior comes with some sample projects that discuss issues 1 and 3,
but they take some work to understand (indeed no sample project
incorporates both characteristics 1 and 3) and to be honest I haven't
understood yet.  I was thinking of programming in CodeWarrior C (I have
version 3.2), though I could switch to different software and/or
programming language if that would help.

If anyone has a template or sample code, ideally with at least
characteristics 1 and 3, you could be my savior.

Thanks in advance,
Ken

This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm



Re: How to create large XCMD / DLL with callbacks

2000-02-28 Thread Yennie

 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