Programming Tips - Microsoft Visual C++: here is how to disable warning C4996

Date: 2023jan3 Product: Visual C++ Keywords: depreciated Q. Microsoft Visual C++: here is how to disable warning C4996 For example:
warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead.
A. Adding this to stdafx.h does NOT work:
#pragma warning(disable: 4996)
What did work for me was adding this at the very top of stdafx.h (Even before including windows.h or stdio.h - in fact this may be key)
#define _CRT_SECURE_NO_WARNINGS #define _CRT_NONSTDC_NO_DEPRECATE