You should then be doing your hands on with C++ because how to put a variable in a class is nothing to do with VC++. The variable pointer you declared in your above code should be moved to CProjectDlg class member variable.