Subj : Re: using LoadLibrary and GetProcAddress with MS DLL To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Thu Mar 17 2005 06:58 am As Borland C++ can create programs for either of 16 bit Windows or 32 bit Windows, when you ask a question please mention which of those is the target type in your situation. It sounds as if your diagnosis is correct. The symptoms you describe are exactly what occurs when the name given to GetProcAddress does not match that found in the DLL. Just for the heck of it, make one more pass through the code to insure that the handle returned from LoadLibrary is both checked for NULL (Win32) or for a value <= HINSTANCE_ERROR (16 bit Windows) and that handle is actually the one passed as the first argument to GetProcAddress. Look at the contents of the *.def file, the module definition file. In it are the public names of the exported functions. Those names are what should be given to GetProcAddress. You can also see the exact text of the public names exported from a DLL by giving a command like this: A command like this will also show the exact text of a DLL's exported names : tdump -ee DllName.DLL Side note: An import library is just an alternate means to implicitly link to a DLL. You can do it by adding either of a module definition file or an import library to the project. The results should be the same from either. .. Ed > Christian Schoett wrote in message > news:42394141$1@newsgroups.borland.com... > > I have a DLL created with Visual C. It uses a .def file to export > the > functions. Until now, I used implib to create a .lib file that can > be > linked to applications created with Borland C++ Builder. Now I > want to load the DLL dynamically from a static library created > with Borland builder using 'LoadLibrary' and 'GetProcaddress'. > 'LoadLibrary' is successful but 'GetProcAddress' always returns > NULL for all functions. I guess it has something to do with the > name mangling but may someone has a hint how to solve this > problem. .