class CInsLibrary { public: CInsLibrary(){;} virtual ~CInsLibrary(){;} public: void Func(int i){;} }; typedef void (CInsLibrary::*PFUNC)(int );
//main.cpp PFUNC pp = CInsLibrary::Func; //1) CInsLibrary* pLib = new CInsLibrary; PFUNC ppp = (pLib->Func); //2) ASSERT(pp == ppp); //caution!! 上面的代码在VC6中编译的很好,但是在VS2005中, 1)必须改为 PFUNC pp = &CInsLibrary::Func; 否则就是Compiler Error C3867
|