RE: Euphoria DLLs

new topic     » topic index » view thread      » older message » newer message

Juergen Luethje wrote:
> I'm considering buying the Eu2C translator.
> The main reason is at the moment, that I'd like to 
> write a plugin for the Total Commander (formerly 
> known as Windows Commander,
> http://www.ghisler.com/). The plugin is technically 
> just a DLL.
>
> In the description of the plugin API, 
> there is for instance:
>   int __stdcall ProcessFile (HANDLE hArcData, int Operation, 
>         char*DestPath, char *DestName)
>
> That looks to me, as if my DLL must be able to 
> exchange addresses, i.e.
> *32*-bit integer values with the Total Commander 
> (floating point values are not requiered at all). 
> But in "e2c.htm" (Eu 2.4 Beta), it reads:
> "Euphoria .dlls (.so's) can be used by C programs 
> as long as only 31-bit integer values are exchanged."
> So is it not possible to write a plugin for 
> the Total Commander (and probably for many 
> other commercial programs) with Euphoria?
>
> I already created a test version of that DLL 
> with the Public Domain Translator (using the 
> Borland C++ Compiler 5.5 on Windows 98), and
> interestingly it works! Does this just happen 
> by chance, because the Total Commander maybe 
> up to now only sended 31-bit values to my DLL, or
> can this DLL be considered reliable?

Things are guaranteed to work if 31-bit integers are
passed. If a 32-bit integer is passed in from C,
things might still work (all the time), 
depending on what you do with that value. 
You would have to examine the
C code generated by the Translator in each case
to determine if 32-bits will work.

If necessary, you could code your own little C
routine, and make that the entry point to
your .dll. It could then handle any 32-bit arguments,
before calling one of your Translator-generated routines.
In general, it could simply convert each C 32-bit integer
into a Euphoria atom (C double) with one C statement.

> How big are the chances that a future version 
> of the translator will create DLLs (and SOs) 
> that exchange 32-bit integer values with C programs?

It depends on how many people need this.
So far I haven't seen many people wanting to call
Euphoria .dll's from C.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu