1. RE: Euphoria DLLs
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
2. RE: Euphoria DLLs
I believe that is just a way to convert the integer pErrorDescription to
an atom. Rob's assignment assures that p is stored as an atom
internally (not as an integer as your assignment would be).
-- Brian
stabmaster wrote:
>
> Rob, why did you use:
>
> > p = 0.0 + pErrorDescription
>
> instead of just:
>
> p = pErrorDescription
>
> Is this some quirk to save cycles that you haven't told us about (or
> that
> i've just missed)?
>
>