Ok, solution is to add #define NOMINMAX in the stdafx.h before including windows.h... frown stupid me.