$NODLLMAIN directive

Purpose: The $NODLLMAIN directive causes BCX to create a DLL without the DllMain code that BCX normally adds to a DLL. This allows a custom DllMain to be used.

Include the $NODLLMAIN directive near the top of the source code file.

Here is a template for a DllMain function.


 FUNCTION DllMain(hInst AS HINSTANCE, _
                       Reason AS DWORD, _
                    Reserved AS LPVOID) EXPORT

 SELECT CASE Reason
 '**************************************************************
 CASE DLL_PROCESS_ATTACH
 ' < -- Do our initializations here  -- >
 MsgBox "Your DLL has been loaded"
 '**************************************************************
 CASE DLL_PROCESS_DETACH, DLL_THREAD_ATTACH, DLL_THREAD_DETACH
 END SELECT

 FUNCTION = TRUE
 END FUNCTION