Re: mfc class wizard problem on visual studio 2005
I understand the missing class wizard so I'm not defending Microsoft's
decisions here, BUT
For your specific example, this works for me. I just tried it again to make
sure, but I also have legacy classes in an MFC extension DLL that I derive
from and it works with those as well.
There's no class wizard, but using the combination of the class view window
and the properties window, I can click on the class in the class view
window. The context of the properties window changes to that class and I
can click on the overrides button and add methods by clicking in the list.
I just tested with a CTestDocDerived class derived from a TestDocBase class
derived from CDocument. It works fine. Note that the messages tab in the
properties window is blank because documents aren't windows.
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"Bin Tian" <tianbin@cernet.edu.cn> wrote in message
news:ucIOs3B$HHA.4784@TK2MSFTNGP05.phx.gbl...
hi, all
I found a problem of mfc class wizards (VS2005 with SP1). If a class
doesn't inherit a MFC class *directly*, e.g. it inherit a class which
inherit a well-known MFC class directly, you can only add message
handlers by hand. And when you open the properties window of the class,
you see the "Events", "Messages" and "Overrides" window are empty.
For example:
1. create a new MFC class CMyDoc based on CDocument firstly.
2. create a second MFC class CMyDocEx based on CDocument. Because the
wizards limit the base class to the well-known MFC class.
3. change the base class of CMyDocEx from CDocument to CMyDoc.
Meanwhile, you should also change the base class in message map and some
other stuff.
4. try to use class wizards to add message handler to CMyDoc or
CMyDocEx. you will see the problem.
Is it a bug or feature of VS2005?? And is there any work-around??
Best regards,
Bin Tian