forum-msg-id-129848-edit

Original date:2016-06-02 04:33:10 Edited by: petelomax Subject: Re: Eu->dll on Windows, can't get it to work

Just a few months ago, I had reason to investigate the E_XXX constants, and ended up writing this (draft):

Phix docs said...

DOC: E_INTEGER/E_ATOM/E_SEQUENCE/E_OBJECT are <i><b>not</b></b> supported. They don&rsquo;t seem to work as advertised on OpenEuphoria either:
http://openeuphoria.org/forum/127457.wc http://openeuphoria.org/forum/124939.wc http://openeuphoria.org/forum/123657.wc http://openeuphoria.org/forum/119179.wc

Neither does http://openeuphoria.org/forum/113522.wc inspire me with confidence, and nor does http://openeuphoria.org/forum/118514.wc though it is the closest (/only) thing my searches yielded that might actually be useful.

One thing that definitely affects Phix, but I can't say about OE, is that if a dll were compiled with it's own copy of the heap manager, then if any function in the dll allocated something and returned it to the calling exe, the latter would most probably try and release it in the wrong heap, which would end pretty badly. I also noted that delete_routine and friends would be utterly hosed, at least for Phix.

The only way I could see round the problem (in Phix) would be that Phix-compiled .dll/so files [when implemented!] should be restricted to C_INT(etc)/C_FLOAT/C_DOUBLE/C_POINTER and in the latter case, should my_dll return a pointer to some memory it had allocated, the calling code would need to my_dll_free(ptr) it after it had retrieved a copy of the returned data.

Also, the parameters to any dll routine would need restricting, like call_back, to atoms.

Pete

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu