문제

I'm trying to implement into ATL :

std::list<CMyClass> listMC;
CMyClass lmc;
listMC.insert(listMC.end(), lmc);

How do I instantiate lmc which is an ATL class which was created using Class View > New > Class ?

I'm actually getting errors on lmc :

Error: object of abstract class type "CProcessusModel" is not allowed :
function "CProcessusModel::AddRef" is a virtual function 
function "CProcessusModel::Release" is a virtual function  
function "CProcessusModel::QueryInterface" is a virtual function

Thanks a lot!

도움이 되었습니까?

해결책

According to your error messages, the class CProcessusModel is abstract. You cannot instantiate abstract classes.

To make your class concrete, you have to

A) Implement the virtual functions that are listed in the error message in the class CProcessusModel or

B) derive a concrete subclass from the abstract CProcessusModel, which implements all pure virtual methods and instantiate objects of that type.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top