1. RE: .dll files -- possibly [OT]
Chris Saik wrote:
>
>
> Hello,
>
> Could someone explain to me the use and more
> importantly the benefits of .dll files? They seem to
> me to be basically include files (I'm most likely
> mistaken), and I'm wondering why use a .dll file vs a
> standard include file? What can be done using a .dll
> file that cannot be done with includes?
>
>
The main benefit of the ability to use .dll files for Euphoria programs
is to be able to use third-party libraries that were most-likely written
in C or some other language. The whole Windows API is available to us
through .dlls installed with the OS, for instance. Graphics libraries,
database libraries, etc are all available in .dll form, often for free.
If you want to make .dlls from Euphoria source and use them with your
Euphoria programs, then it is indeed quite like using an include file.
The advantages are greater speed for those parts of the program in the
.dll, and the ability to share them with others without revealing your
source code. You could also use a Euphoria .dll as an external library
with a program written in some other language, but you're then somewhat
restricted on what parameters you can pass...
2. RE: .dll files -- possibly [OT]
Thanks Andy. So are .dlls "included", or do you just
place the .dll in the \windows\system\ directory and
call the functions directly? I would imagine the
latter, since you state that other languages can
access .dlls written in most any language (with the
possible parameter restrictions, of course) and
without revealing the source code.
--- Andy Serpa <ac at onehorseshy.com> wrote:
>
>
> Chris Saik wrote:
> >
> >
> > Hello,
> >
> > Could someone explain to me the use and more
> > importantly the benefits of .dll files? They seem
> to
> > me to be basically include files (I'm most likely
> > mistaken), and I'm wondering why use a .dll file
> vs a
> > standard include file? What can be done using a
> .dll
> > file that cannot be done with includes?
> >
> >
> The main benefit of the ability to use .dll files
> for Euphoria programs
> is to be able to use third-party libraries that were
> most-likely written
> in C or some other language. The whole Windows API
> is available to us
> through .dlls installed with the OS, for instance.
> Graphics libraries,
> database libraries, etc are all available in .dll
> form, often for free.
>
> If you want to make .dlls from Euphoria source and
> use them with your
> Euphoria programs, then it is indeed quite like
> using an include file.
> The advantages are greater speed for those parts of
> the program in the
> .dll, and the ability to share them with others
> without revealing your
> source code. You could also use a Euphoria .dll as
> an external library
> with a program written in some other language, but
> you're then somewhat
> restricted on what parameters you can pass...
>
>
>
>
> TOPICA - Start your own email discussion group.
> FREE!
>
>
>
3. RE: .dll files -- possibly [OT]
Chris Saik wrote:
>
>
> Thanks Andy. So are .dlls "included", or do you just
> place the .dll in the \windows\system\ directory and
> call the functions directly? I would imagine the
> latter, since you state that other languages can
> access .dlls written in most any language (with the
> possible parameter restrictions, of course) and
> without revealing the source code.
>
>
Yeah, you've got to "link" the functions in the dll with your program by
using open_dll(), define_c_func() & define_c_proc() (see REFMAN). Then
you call the functions with c_func() or c_proc(). Sometimes other
overhead needs to be done to send the parameters properly (poking a
character string into memory with allocate_string(), for instance).
This process is known as "wrapping" the .dll -- making a "wrapper".
(Search the archive with the word wrapper and you'll find some.)
Using a Euphoria-created .dll is a lot simpler than using one made in a
different language where you'll generally need a bit of knowledge about
C to figure out how to wrap it properly...