Re: Euphoria DLLs

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

Juergen Luethje wrote:
>>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.
> 
> 
> The 32 bit values that are passed in from the main
> program [1] to my DLL are memory addresses, that the
> DLL code uses for peek()ing and poke()ing.
> 
> 
>>You would have to examine the
>>C code generated by the Translator in each case
>>to determine if 32-bits will work.
> 
> 
> What rules shall I use to make such decisions?
> Unfortunately, I almost don't know anything about C
> programming.

If you don't know C, it will be difficult to know
if everything is OK.

>>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.
> 
> 
> Maybe you (or someone else) could give me a template or
> an example how to do this?

I'll make a little example, and add it
to the documentation.

>>>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.
>
> If Euphoria could produce industry standard DLLs, I
> think it also could be for instance very useful for
> Visual Basic programmers to use a DLL created with
> Euphoria to speed up critical parts of their code.
> 
> TIA, and best regards,
>    Juergen
> 
> --=----=---=---=---=---=---=---=---=--
> [1] The main program that calls my DLL (Total Commander)
>     is actually written in Delphi, not in C. I don't know
>     whether that matters here.

The data types are probably very similar to C.

By the way, this annoying Topica problem is also
happening on other Topica lists. Topica is aware of it.
I hope they fix it soon. I'm going to remove the
"Euphoria Mailing List" title line in the Topica
admin page. Maybe that will help.

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

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

Search



Quick Links

User menu

Not signed in.

Misc Menu