//
// MyDLL.h
//
// Visual C++ version
#ifdef MYDLL_IMPORT
#define MYDLL_API _declspec(dllimport)
#else
#define MYDLL_API _declspec(dllexport)
#endif
// You'll have to find the way Borland declares variables as imported/exported
// and replace _declspec(...) with the appropriate commands
// Force compiler to use undecorated function/variable names.
// This is most useful if you plan to dynamically link the DLLs.
extern "C"
{
void MYDLL_API MyDLLFunc( void );
}
//
// MyDLL.cpp
//
#include "MyDLL.h"
void MYDLL_API MyDLLFunc( void )
{
}
Add the two above files to an empty DLL project and it will compile a DLL that exports one function (MyDLLFunc) that does nothing. You get the idea. Also, to import the DLL into a project, link the project to the .lib file compiled with the DLL and include the .h file like this:
//
// MyProject.cpp
//
#define MYDLL_IMPORT
#include "MyDLL.h"
Then you can just call the functions exported in the DLL wherever you like. If you want to dynamically load the DLLs (load them without having to link to their lib), check out the Windows API commands LoadLibrary and GetProcAddress.