From: Michael G. <mg...@te...> - 2005-10-20 07:35:23
|
[long explanation about how the original poster assumes loading of a DLL during runtime should work -- skipped] > Maybe I'm missing something in creating DLL using mingw. You are missing something about using a DLL loaded with LoadLibrary and of course how functions whose addrs are retrieved by GetProcAddress are used. Wether or not there exists a DllMain is completely irrelevant to you (from a point of loading the DLL). That is taken care of by LoadLibrary (and -of course- the creator of the DLL). You just load the DLL with LoadLibrary and use the returned HANDLE to load the Addrs of the functions you wish to call by using GetProcAddress. The resulting function ptrs are used just like "normal" functions. You definitely should RTFM, e.g. MSDN. You may as well check the archive of this list as this very topic had occasionally been discussed over the years. Last not least I'm sure resorting to google will give you plenty of advice as well. > How to create such Win32 DLL using mingw? Your problem is not _creating_ such a DLL as it is created like any other DLL - it is in fact not a special DLL in any way. Your problem is that you do not yet seem to understand how this dynamic loading and retrieving addrs from the DLL at runtime works. HTH, best, Michael =2D-=20 Vote against SPAM - see http://www.politik-digital.de/spam/ Michael Gerdau email: mg...@te... GPG-keys available on request or at public keyserver |