I've converting a Fortran 77 code that has lots of stack memory utilization from an executable to a DLL (Windows). For example there are hundreds (thousands) of arrays such as this:
COMMON/A1/ CU1(LCM,KCM), CU2(LCM,KCM), 2 UUU(LCM,KCM), VVV(LCM,KCM), WWW(LCM,0:KCM), 3 DU(LCM,KCM), DV(LCM,KCM), 4 FX(LCM,KCM), FY(LCM,KCM)
After modifying the stack reserve size to be as large as possible the program compiles and runs as a standalone executable. When it's compiled as a DLL it crashes with:
Unable to load DLL 'LIB.dll': Not enough storage is available to process this command. (Exception from HRESULT: 0x80070008)
What is the difference in a DLL and EXE that is causing this?