I use the NOMINMAX macro and call my dll from C#, everything works fine. If it compiles, are you sure the crash is related to preprocessor definitions ? Is there error message when you try to call it from C# ?