At 7:44 AM -0400 10/26/04, Leonard Rosenthol wrote:
Following up on some discussions of earlier about how to pass a
"callback function" into a plugin, so that the plugin can call on
the RB app as needed (progress, threading, etc.)
What is the best/approved/recommended method for doing this?
Passing in an AddressOf?
Emphatically NO.
REALLoadObjectMethod()?
Again, NO.
Other?
Yes: make your code a class, if it is not already, that declares
events for whatever "callbacks" it needs. Then locate and invoke
these with REALGetEventInstance.
I'm not sure what earlier discussion you're talking about, but you
should *never* pass a callback function into a plugin. If you ever
find yourself tempted to use AddressOf with a plugin, you should take
a deep breath and step calmly away from the cliff. AddressOf is
intended for system functions or shared libraries beyond your
control; plugins have a much better "callback" mechanism, and always
have.
Best,
- Joe
--
REAL World 2005 - The REALbasic User Conference
March 23-25, 2005, Austin, Texas
<http://www.realsoftware.com/realworld>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|