Board index » cppbuilder » DllMain vs DllEntryPoint
DllMain vs DllEntryPoint
2006-03-05 10:58:34 PM
I'm trying to rebuild a VS DLL project with BCB.
I created a new DLL project with the VS option
checked, removed the created main cpp file
and added the source code files from the VS project.
After some tweaks it compiled and linked fine
but I have problems with the entry point function.
Since I used the VS option the entry point expected
is DllMain() at least this is what I see in the .bpf file.
This DllMain() function is implemented as follows:
// Comment from the original VS project:
// If we declare the correct C runtime entrypoint and then forward it to the
// classes we will be sure that both the C/C++ runtimes and the base classes
extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved)
//MessageBox(0, "DllMain", "", 0);
return DllEntryPoint(reinterpret_cast<HINSTANCE>(hDllHandle), dwReason,
The referenced DllEntryPoint() function is implemented
in the "base class library".
Problem: the above DllMain() gets never called. Instead
the DllEntryPoint() function seems to be called directly.
Like BCB ignores the direction to call DllMain().
Any ideas how to solve this?