'interface' : an interface can only have public members
Protected and private members may be accessed only from other member functions. Such members are no use in an interface, since it may not provide implementations for any of its members.
The following code will generate C2862:
// compile cl /c #include <unknwn.h> #undef interface #pragma keyword("interface", on) [com, uuid="60719E20-EF37-11D1-978D-0000F805D73B"] interface IMyInterface { HRESULT mf1(void); // OK protected: HRESULT mf2(int *b); // 2862 : An interface may only have public methods private: HRESULT mf3(int *c); // 2862 : An interface may only have public methods };