Hey all,
I have come across the following issue. I have an application written
with Borland C++ Builder, this application loads dlls(plug-ins)
dynamically during run time. To make things easier for my users, I am
trying to make it possible for them to create dlls in C++ Builder
(which works great) and VC++. I tried to use the same code in VC++
builder, which compilled fine, but during runtime I came across a
problem. First of all, this is how I load my DLLS in the host app:
LibAddress = LoadLibrary("C:\\Development\\VC++
DLL\\Release\\DLL.dll");
Connect = (TConnect) GetProcAddress(mydll->LibAddress,"_Connect);
//trying to get a function from the dll
now, in my DLL I export the function Connect the following way in
both dlls:
#define DLL_MODE __declspec(dllexport)
extern "C" void DLL_MODE Connect(TUser*User);
now, this works fine with the BCB dll, but loading the function with
GetProcAddress from the VC++ returned NULL. Using Dumpbin on the DLL
showed that the function was exported as Connect not as _Connect.
Changing the function to look for Connect instead of _Connect worked,
but why is this? Is there a way to get VC++ to report the name
correctly?
thank you
Seabass