DLL usage in RunRev

Ken Ray kray at sonsothunder.com
Mon Nov 28 08:46:49 EST 2005


On 11/28/05 2:23 AM, "Alessandro Manotti" <ale870 at gmail.com> wrote:

> Author says it functions correctly.
> But the RunRev documentation about "externals" suggests to close
> (destroy) and open stack.
> 
> What's the right procedure (how to use externals and close/open stack
> without losing externals configuration)?

Here's the deal - Rev only loads Rev-specific externals into memory when a
stack that has the "externals" property is loaded. This happens before any
messages are sent (with the exception of the "startup" message, which only
goes to standalones). So if you already have your stack open, and you
"attach" externals to it through the "set the externals to ___" command,
those externals won't be available to that stack until the stack is saved,
closed, and reopened, or is put into use as a library through "start using".

Trevor Devore had a great idea that I (and others) have used - that is to
attach the externals to a *substack* of the mainstack (I call mine
"Externals" - I know, not very original :-), and then "start using" the
substack as a library. This kicks the externals into gear immediately and
makes them available. If I need to add other externals, all I need to do is
"stop using" the Externals stack, and then "start using" it again to get it
loaded.

> 
> More:
> let's suppose I need to use a generic DLL (not RunRev specific). And
> let's suppose this dll is already registered.
> Can you suggest the the smartest method to register and use it?

Well, if it's already registered, then the only things you need to know is
what function you want to call in the DLL and what the DLL's class name is.
Personally, I always attempt to register the DLL anyway with my
stsRegisterDLL handler, because it calls the internal function
_stsIsRegistered which will return true or false if the DLL is registered
and won't register it again if it's already registered.
 
> I tried to use some windows dll (just to try) using the previous code,
> but nothing happened (only errors...). My second problem is I have not
> a dll to test (my application must be able to use any dll, based on a
> script supplied from another program...).
> 
> So... can you suggest me a proven method to use a generic windows dll?

Once again, I direct you to the tip at my site:

http://www.sonsothunder.com/devres/revolution/tips/ext002.htm

This very clearly explains how to use a generic windows DLL. If it doesn't
work for you, let me know what errors you receive and I'll help you
troubleshoot it.
 
> Last item (I'm sorry): and about ".so" Linux files? Or Linux dynamic library?

Sorry, no idea about that - I haven't done anything with Linux libraries...

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list