Roger Cigol 107 Posted October 20, 2022 I have a C++ Builder application that is in two parts - a dll and a main exe. This has all been working fine with version XEn ... 10.0... 10.1... 10.4.... etc (and maybe 11.1 too). But when I compiled it with 11.2 patch 1 I found it compiled without errors but didn't run. I traced the problem to DllMain() not being called when the dll is "attached" as the exe file loads. When I changed this from DllMain() to DllEntryPoint() it all started working again. (Phew!). This page: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Creating_DLLs_in_C%2B%2BBuilder Suggests that there is an option (check box) called VC++ which selects either DllMain() or DllEntryPoint(). But I can't find this option ! anyone know where this is for version 11.2 patch 1 ? Share this post Link to post
Remy Lebeau 1421 Posted October 20, 2022 6 hours ago, Roger Cigol said: This page: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Creating_DLLs_in_C%2B%2BBuilder Suggests that there is an option (check box) called VC++ which selects either DllMain() or DllEntryPoint(). But I can't find this option ! anyone know where this is for version 11.2 patch 1 ? I don't have 11.2.1 to verify this, but the checkbox should be in the initial dialog when creating a new DLL project. It is not something you can toggle in the Project Options after the project is created. 1 Share this post Link to post
Roger Cigol 107 Posted October 20, 2022 Hi Remy, Well that would explain why I can't find it ! But it doesn't explain why I've suddenly had to change a working using MainDLL() project to having to use DllEntryPoint() in order to get it to work. My own notes suggest that the last time I rebuilt this project was 11.1.5 - so I suspect the change has happened just with 11.2 Any way thanks for your help. As I have solved the problem it's probably not worth further chasing ! Share this post Link to post
Fraser 2 Posted December 7 With 12.1 DllMain has been changed to _libmain. It also has a different signature to DllEntryPoint. extern "C" int _libmain(unsigned long reason) { return 1; } Share this post Link to post
DelphiUdIT 182 Posted December 7 I have been using it for many years and have never changed it... int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved) {....} Share this post Link to post