nicolasr
2006-03-05 14:58:34 UTC
Hi,
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
DShow base
// classes we will be sure that both the C/C++ runtimes and the base classes
are initialized
// correctly
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,
lpReserved);
}
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?
thanks,
Nick
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
DShow base
// classes we will be sure that both the C/C++ runtimes and the base classes
are initialized
// correctly
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,
lpReserved);
}
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?
thanks,
Nick