Gide me to use Windows DLL in a Linux application.

Mike Hearn mike at theoretic.com
Sun Mar 9 06:25:34 CST 2003


Doing that kind of thing is fairly advanced right now - look at the
mplayer source code, they've copied and pasted parts of the wine loader
to use Win32 codecs in a native linux app.

thanks -mike

On Sun, 2003-03-09 at 12:07, Alireza Mahini wrote:
> Hi
> I would like to use a win32 DLL in a native Linux application. I want
> to do this by using WINE.
> According to the documentation that comes with the DLL, a Windows
> program can load it with the following code (the names have been
> changed to protect the innocent -- me):
> 
> HMODULE hDLL;
> FARPROC lpfnFunc1, lpfnFunc2;
> 
> hDLL = LoadLibrary ("library.dll");
> if (hDLL == (HMODULE) NULL)
> return ERROR;
> 
> lpfnFunc1 = (LPAPPFUNC1) GetProcAddress (m_hDLL, "Function1");
> lpfnFunc2 = (LPAPPFUNC2) GetProcAddress (m_hDLL, "Function2");
> 
> I created the following test program:
> 
> #include <wine/wine/winbase.h>
> 
> int main (int argc, const char *arvg[])
> {
> HMODULE hDLL;
> 
> hDLL = LoadLibrary ("library.dll");
> if (hDLL == (HMOD! ULE) NULL)
> return 1;
> else
> return 0;
> }
> 
> When I try to build it, however, I get an "undefined reference to
> 'LoadLibraryA'". Linking libwine.so does not fix this.
> Do i try with additional flags for g++ compiler? Or Is my code wrong ?
> please ,guide me to solve this problem .
> 
> Regards
> Alireza Mahini
> 
> 
> 
> ______________________________________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web!




More information about the wine-devel mailing list