Dynamic Loading of DLLs

4 messages Options
Embed this post
Permalink
dciphercomputing

Dynamic Loading of DLLs

Reply Threaded More More options
Print post
Permalink
Hi

Is it possible to use DLLS from other software without first creating a wrapper class.  The problem I have is that it is a long process to wrap some DLLs.  For example the header file for one of my DLLs is 4600 lines long.  To be honest I can see that there might be occasions when I would like the ability to create such a wrapper but I have a number of DLLs that I want like to use and building wrapper classes will take way too much time.  Not only that I suspect that these wrapper classes will have to be updated every time I get a new version of the dlls.  I would prefer an alternate method similar to the Declare/LoadLibrary statement  used in some other programming languages.  Is such possible in Eiffel?  If it is possible can you give me an example?

Thanks,
Simon

Chris Saunders-4

Re: Dynamic Loading of DLLs

Reply Threaded More More options
Print post
Permalink
As I mentioned in my last message I haven't used dlls so I'm afraid I can't help there.  Updating older libraries is fairly simple.  First if the new library has no new functions then your old interface needs no changes you just need to use the new *.lib or *.dll file in your project settings.  If there are new functions you can inherit from your existing interface class using an appropriate new name and just add the new functions or I personally would prefer to just add the new functions to the older interface class.

Regards
Chris Saunders

  ----- Original Message -----
  From: dciphercomputing
  To: [hidden email]
  Sent: Monday, October 26, 2009 9:47 PM
  Subject: [eiffel_software] Dynamic Loading of DLLs


    Hi

  Is it possible to use DLLS from other software without first creating a wrapper class. The problem I have is that it is a long process to wrap some DLLs. For example the header file for one of my DLLs is 4600 lines long. To be honest I can see that there might be occasions when I would like the ability to create such a wrapper but I have a number of DLLs that I want like to use and building wrapper classes will take way too much time. Not only that I suspect that these wrapper classes will have to be updated every time I get a new version of the dlls. I would prefer an alternate method similar to the Declare/LoadLibrary statement used in some other programming languages. Is such possible in Eiffel? If it is possible can you give me an example?

  Thanks,
  Simon



 

[Non-text portions of this message have been removed]

Marco Trudel

Re: Dynamic Loading of DLLs

Reply Threaded More More options
Print post
Permalink
In reply to this post by dciphercomputing
Hey Simon

dciphercomputing wrote:
> Hi
>
> Is it possible to use DLLS from other software without first creating a wrapper class.

Are you maybe looking for something like this (the example calls
"System.currentTimeMillis()" from the Java jvm.dll):

     JVM_CurrentTimeMillis (env, this: POINTER) : INTEGER_64
         external
             "dll %"jvm.dll%" signature (EIF_POINTER, EIF_POINTER) :
EIF_INTEGER_64"
         alias
             "_JVM_CurrentTimeMillis@8"
         end

On Windows, you would have to use "dllwin" instead of "dll".


Hope that helps
Marco


> The problem I have is that it is a long process to wrap some DLLs.  For example the header file for one of my DLLs is 4600 lines long.  To be honest I can see that there might be occasions when I would like the ability to create such a wrapper but I have a number of DLLs that I want like to use and building wrapper classes will take way too much time.  Not only that I suspect that these wrapper classes will have to be updated every time I get a new version of the dlls.  I would prefer an alternate method similar to the Declare/LoadLibrary statement  used in some other programming languages.  Is such possible in Eiffel?  If it is possible can you give me an example?
>
> Thanks,
> Simon
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

dciphercomputing

Re: Dynamic Loading of DLLs

Reply Threaded More More options
Print post
Permalink
Yes I think that is what I am looking for so I will now have to test it out using my dlls.

Simon

--- In [hidden email], Marco Trudel <marco@...> wrote:

>
> Hey Simon
>
> dciphercomputing wrote:
> > Hi
> >
> > Is it possible to use DLLS from other software without first creating a wrapper class.
>
> Are you maybe looking for something like this (the example calls
> "System.currentTimeMillis()" from the Java jvm.dll):
>
>      JVM_CurrentTimeMillis (env, this: POINTER) : INTEGER_64
>          external
>              "dll %"jvm.dll%" signature (EIF_POINTER, EIF_POINTER) :
> EIF_INTEGER_64"
>          alias
>              "_JVM_CurrentTimeMillis@8"
>          end
>
> On Windows, you would have to use "dllwin" instead of "dll".
>
>
> Hope that helps
> Marco
>
>
> > The problem I have is that it is a long process to wrap some DLLs.  For example the header file for one of my DLLs is 4600 lines long.  To be honest I can see that there might be occasions when I would like the ability to create such a wrapper but I have a number of DLLs that I want like to use and building wrapper classes will take way too much time.  Not only that I suspect that these wrapper classes will have to be updated every time I get a new version of the dlls.  I would prefer an alternate method similar to the Declare/LoadLibrary statement  used in some other programming languages.  Is such possible in Eiffel?  If it is possible can you give me an example?
> >
> > Thanks,
> > Simon
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>