It seems that you can not use MFC in Generic C++ Classes. You must choose MFC project from the start, at least on Visual Studio .NET.