Including a class in an MFC project
-
I've made this work but I'm wondering if there's a better way that I'm overlooking. So, I've developed a sub-class of a CEdit control in a development environment. I've got the two files MyCEdit.cpp and MyCEdit.h sitting in a directory of my development environment. My latest and greatest (at least most time consuming) project needs to use the new class object. I can't use New Class because that means I have to start from scratch. I can't add the class from a type library coz it isn't in one. So all I can do, and have done, is include the two files in my project. At this point the class wizard doesn't appear to know that CMyCEdit exists. Under Member Variables/Add Variable the Variable Type doesn't know that I've just introduced CMyEdit. I include MyCEdit.h in the ??????Dlg.h file and no difference. In order to make the class appear in the class wizard I have to make sure that the class header file is #included in either the dialog or view header. I then delete/rename the .CLW file, invoke the class wizard which then offers to rebuild the class data from the files involved. Certainly there has to be a better way to do this more directly through VC++. :confused: TIA, Lilith
-
I've made this work but I'm wondering if there's a better way that I'm overlooking. So, I've developed a sub-class of a CEdit control in a development environment. I've got the two files MyCEdit.cpp and MyCEdit.h sitting in a directory of my development environment. My latest and greatest (at least most time consuming) project needs to use the new class object. I can't use New Class because that means I have to start from scratch. I can't add the class from a type library coz it isn't in one. So all I can do, and have done, is include the two files in my project. At this point the class wizard doesn't appear to know that CMyCEdit exists. Under Member Variables/Add Variable the Variable Type doesn't know that I've just introduced CMyEdit. I include MyCEdit.h in the ??????Dlg.h file and no difference. In order to make the class appear in the class wizard I have to make sure that the class header file is #included in either the dialog or view header. I then delete/rename the .CLW file, invoke the class wizard which then offers to rebuild the class data from the files involved. Certainly there has to be a better way to do this more directly through VC++. :confused: TIA, Lilith
Lilith.C wrote:
Certainly there has to be a better way to do this more directly through VC++.
Not necessarily. Deleting a project's temporary files (e.g., ncb, opt, clw, aps) is actually quite common.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb