In Delphi, I want to define the constants as follows:
const
LANG_BUL = MAKELANGID(LANG_BULGARIAN, SUBLANG_DEFAULT);
But will get
[dcc32 Error] Utils.pas(15): E2026 Constant expression expected
How can let the compiler preprocess the macro and generate the constants before the compile starts?
In Delphi there are no macros.
MAKELANGIDis a function - see unitWinapi.Windows. As such it can't be used to define a constant. You can manually "expand"MAKELANGIDas a workaround: