Uwe Bonnes wrote:
> 
> [EMAIL PROTECTED] writes:
> > How do you proceed when wine call native DLLs like gdi32.dll ?
> > How wine is linked so it nows how to call functions in gdi32.dll ?
> >
> > Couldn't I use the same for my linux program be able to call chli.dll
> > exports ?
from your small test program, what you need to do is
in a chli_imp.c file:

----8<------
#include "hli.h"

static HANDLE chli_handle = 0;

/* be sure prototype is correct. could be
        int WINAPI cfmini(int*)
        void cfmini(int*)
        ...
*/
int cfmini(int * p)
{
        static void (*pcfmini)(int*) = 0;

        if (!chli_handle) {
                chli_handle = LoadLibrary("chli.dll");
                if (!chli_handle) MESSSAGE("can't load lib\n");
        }
        
        if (!pcfmini) {
                pcfmini = GetProcAddress(chli_handle, "cfmini");
                if (!pcfmini) MESSSAGE("can't get proc address\n");
        }
        return (*pcfmini)(p);
}
----8<------
(the import tool produces the code automatically, and in a more efficient and reduced 
way)

HTH

A+
-- 
---------------
Eric Pouech (http://perso.wanadoo.fr/eric.pouech/)
"The future will be better tomorrow", Vice President Dan Quayle

Reply via email to