Re: DLL usage in RunRev

2005-11-28 Thread Alessandro Manotti
Thank you for suggestions and links ;-)

But I noticed a bit of confusion about this argument (inside forum and
mailing-list, and RunRev documentation).

I will try to be more specific.

Please read the this (from mailing list):


Hi Eric,

here's the script from MetaCard's stack components...

on mouseUp
  local f
  if the platform is Win32
  then put *.dll into f
  else put * into f
  answer file Choose an external: with external with filter f
  if it is not empty then
set the itemDelimiter to /
if field List is not empty
then put return after field List
put the last item of it after field List
set the externals of stack the label of button Stack Name to field
List
  end if
end mouseUp



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 loosing externals configuration)?

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?

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?

Last item (I'm sorry): and about .so Linux files? Or Linux dynamic library?

Thank you in advance for your help!

--Alessandro








On 11/28/05, Ken Ray [EMAIL PROTECTED] wrote:
 On 11/27/05 5:12 AM, Alessandro Manotti [EMAIL PROTECTED] wrote:

  Hello,
 
  can someone help me to understand how to use a Windows DLL in RunRev?

 Allesandro, we just went over this topic a few weeks back. It's detailed in
 the tip at my site:

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

 Basically an DLL is either built exclusively for Revolution using the
 headers/source provided in the Externals kit, or it is a third party DLL (a
 normal DLL). Revolution externals are loaded with the set the externals
 to list of externals command (see externals in the Transcript
 Dictionary), and third party DLLs *can* be used, but you have to provide an
 intermediary to call them (see the tip).

 Hope this helps,

 Ken Ray
 Sons of Thunder Software
 Web site: http://www.sonsothunder.com/
 Email: [EMAIL PROTECTED]

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-28 Thread Rishi Viner
Hi Ken,

Thanks for the great tip (below). Do you have any links / info / experience in 
doing this with Linux .so (shared object) files? I would be interested in 
doing this with database drivers to isolate myself from version changes. Any 
help / links appreciated...

  Basically an DLL is either built exclusively for Revolution using the
  headers/source provided in the Externals kit, or it is a third party DLL
  (a normal DLL). Revolution externals are loaded with the set the
  externals to list of externals command (see externals in the
  Transcript Dictionary), and third party DLLs *can* be used, but you have
  to provide an intermediary to call them (see the tip).
 
  Hope this helps,
 
  Ken Ray
  Sons of Thunder Software
  Web site: http://www.sonsothunder.com/
  Email: [EMAIL PROTECTED]



-- 
Rishi Viner
--
PUREDATA
Australia

www.puredata.com.au
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-28 Thread Ken Ray
On 11/28/05 2:23 AM, Alessandro Manotti [EMAIL PROTECTED] 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: [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-28 Thread Ken Ray
On 11/28/05 4:27 AM, Rishi Viner [EMAIL PROTECTED] wrote:

 Hi Ken,
 
 Thanks for the great tip (below). Do you have any links / info / experience in
 doing this with Linux .so (shared object) files? I would be interested in
 doing this with database drivers to isolate myself from version changes. Any
 help / links appreciated...

Sorry, Rishi... no experience here on Linux .so files; I've only used Linux
to test and run stacks/apps that didn't need them so I'm not much help here.


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-28 Thread Alessandro Manotti
Thank you Ken for your support.

I discovered I forgot to insert a the in front of externals   :-(

It worked, but only RunRev dlls (sure compiled with RunRev toolkit).
I currently work in Delphi (but I know other low-level programming
languages) and I not yet understand why RunRev makes the difference
between RunRev-DLL and Non-RunRev DLLs.

Basically, the dll has a unique structure; the only difference is
parameters passing using stack (from left to right: pascal-style;
right-to-left: C-style).

However... I will use this proxy-like system, using VBS (great example!).

Thank you!




On 11/28/05, Ken Ray [EMAIL PROTECTED] wrote:
 On 11/28/05 4:27 AM, Rishi Viner [EMAIL PROTECTED] wrote:

  Hi Ken,
 
  Thanks for the great tip (below). Do you have any links / info / experience 
  in
  doing this with Linux .so (shared object) files? I would be interested in
  doing this with database drivers to isolate myself from version changes. Any
  help / links appreciated...

 Sorry, Rishi... no experience here on Linux .so files; I've only used Linux
 to test and run stacks/apps that didn't need them so I'm not much help here.


 Ken Ray
 Sons of Thunder Software
 Web site: http://www.sonsothunder.com/
 Email: [EMAIL PROTECTED]

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-28 Thread Ken Ray
On 11/28/05 10:01 AM, Alessandro Manotti [EMAIL PROTECTED] wrote:

 It worked, but only RunRev dlls (sure compiled with RunRev toolkit).
 I currently work in Delphi (but I know other low-level programming
 languages) and I not yet understand why RunRev makes the difference
 between RunRev-DLL and Non-RunRev DLLs.
 
 Basically, the dll has a unique structure; the only difference is
 parameters passing using stack (from left to right: pascal-style;
 right-to-left: C-style).

Well, Rev DLLs have a special header that must be compiled into the
external, which I assume is expected by the Revolution engine when it goes
to load it. Personally, I'd *love* to see Rev use normal DLLs so the
workaround wouldn't be necessary, but until that happens at least there's a
way to do it.

 However... I will use this proxy-like system, using VBS (great example!).

Thanks!


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-28 Thread Alessandro Manotti
Sorry Mark, but in my company I already use Delphi to create DLLs
(using cdecl option for parameters passing)   ;-)

I don't know if I can use Delphi to create dll specific for RunRev,
but Delphi can create dll for windows (and, of course, I can read/use
every dll).
Some problems occurred in older Delphi versions (more about ocx).

But now the situation seems ok.




On 11/28/05, Mark Wieder [EMAIL PROTECTED] wrote:
 Alessandro-

 Monday, November 28, 2005, 8:01:14 AM, you wrote:

  It worked, but only RunRev dlls (sure compiled with RunRev toolkit).
  I currently work in Delphi (but I know other low-level programming
  languages) and I not yet understand why RunRev makes the difference
  between RunRev-DLL and Non-RunRev DLLs.

 I doubt you'll be able to create compatible DLLs using Delphi. I know
 you can't do it using Borland's C++ compilers. I wish it were
 otherwise, but it's a limitation in Borland's linker. You can't get
 the right combination of options to create a DLL that is recognized by
 the engine..

  Basically, the dll has a unique structure; the only difference is
  parameters passing using stack (from left to right: pascal-style;
  right-to-left: C-style).

 There are other differences as well. You need to be able to export
 items in Mixed Case and without a leading underscore. You need to be
 able to specify that the calling routine (not the called one) has the
 responsibility for cleaning up the stack after the call.

 --
 -Mark Wieder
  [EMAIL PROTECTED]

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-28 Thread Mark Wieder
Alessandro-

Monday, November 28, 2005, 1:15:45 PM, you wrote:

 Sorry Mark, but in my company I already use Delphi to create DLLs
 (using cdecl option for parameters passing)   ;-)

Yes, sorry, I didn't mean to imply that you couldn't create DLLs, just
that you probably can't create *runrev-compatible* DLLs.

-- 
-Mark Wieder
 [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-28 Thread Alessandro Manotti
I didn't see the RunRev sdk, but I think you agree. I think SDK was
created to be used with C or C++. Neither Delphi nor Visual Basic,
etc...





On 11/28/05, Mark Wieder [EMAIL PROTECTED] wrote:
 Alessandro-

 Monday, November 28, 2005, 1:15:45 PM, you wrote:

  Sorry Mark, but in my company I already use Delphi to create DLLs
  (using cdecl option for parameters passing)   ;-)

 Yes, sorry, I didn't mean to imply that you couldn't create DLLs, just
 that you probably can't create *runrev-compatible* DLLs.

 --
 -Mark Wieder
  [EMAIL PROTECTED]

 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: DLL usage in RunRev

2005-11-27 Thread MisterX
Hi Alessandro

There's lots of ink spilled in the mailist about those...

You can't interface directly to DLLs without an API call that you make via
shell or a custom external command.

Depends on what you need...
Tell us more... There's usually other ways in Rev ;)

Get the ActiveSearch Stack from the RevOnline files... fast Search engine
in the comfort of rev

or via the web

http://www.mail-archive.com/cgi-bin/htsearch?method=andformat=shortconfig
=use-revolution_lists_runrev_comrestrict=exclude=words=DLL
Whatch for line cuts in the url...

cheers
Xavier
http://monsieurx.com/taoo

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Alessandro Manotti
 Sent: Sunday, 27 November, 2005 12:13
 To: use-revolution@lists.runrev.com
 Subject: DLL usage in RunRev
 
 Hello,
 
 can someone help me to understand how to use a Windows DLL in RunRev?
 
 I cannot find the exact function to load a library and use 
 the functions contained inside.  :-(
 
 Thank you!
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage 
 your subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: DLL usage in RunRev

2005-11-27 Thread Ken Ray
On 11/27/05 5:12 AM, Alessandro Manotti [EMAIL PROTECTED] wrote:

 Hello,
 
 can someone help me to understand how to use a Windows DLL in RunRev?

Allesandro, we just went over this topic a few weeks back. It's detailed in
the tip at my site:

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

Basically an DLL is either built exclusively for Revolution using the
headers/source provided in the Externals kit, or it is a third party DLL (a
normal DLL). Revolution externals are loaded with the set the externals
to list of externals command (see externals in the Transcript
Dictionary), and third party DLLs *can* be used, but you have to provide an
intermediary to call them (see the tip).

Hope this helps,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution