I have a solution that you cannot consider terribly "clean", but which will work. The problem is that using the enum or #define preprocessor directives will discard the symbolic name you use for the constant (for example, ERR_OUT_OF_MEMORY will really be just an integer).
++ , . std:: map, , std:: pair ( "ERR_OUT_OF_MEMORY", ERR_OUT_OF_MEMORY). DLL, DllImportAttribute, interop .NET. , , , , .
- script, #defines .NET . , ( Perl)