How do you handle a “cannot instantiate abstract class” error in C++?

后端 未结 8 2084
暗喜
暗喜 2020-12-15 17:02

How do you handle a \"cannot instantiate abstract class\" error in C++? I have looked at some of the similar errors here and none of them seem to be exactly the same or prob

8条回答
  •  天涯浪人
    2020-12-15 17:40

    In my case i declared a function in COM Control .idl file like

    [id(1)] HRESULT MyMethod([in]INT param);
    

    but not declared in my interface .h file like this

    STDMETHOD(MyMethod)(INT param);
    

    Problem solved by adding above line into my interface .h file

    this might help some one .

提交回复
热议问题