Pergunta

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!

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top