我自己建一个新类class CCustomControlSite:public COleControlSite
完成后编译出错
error C2504: 'COleControlSite' : base class undefined
error C2504: 'COccManager' : base class undefined
error C2664: 'AfxEnableControlContainer' : cannot convert parameter 1 from 'class CCustomOccManager *' to 'class COccManager *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
网上查了半天也没有确切的说明,最后经过网友提示要加#include <..\src\occimpl.h>,我在.CPP中加了还是提示上面的错误,研究这篇资料http://blog.csdn.net/mail_cm/article/details/7817624,慢慢体会到要加到CCustomControlSite头文件之前,所以在包含CCustomControlSite头文件之前也要加#include <..\src\occimpl.h>,最后编译通过。