NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2863

'interface' : an interface cannot have friends

Declaring friends on an interface is not allowed. The following sample demonstrates instances of this error:

// compile : cl /c
#include <unknwn.h>
#undef interface
#pragma keyword("interface", on)

interface IMyInterface1;

class CMyClass {
   void *f();
}; 

interface IMyInterface {
   void g();
   friend int h();  // 2863 : An interface cannot have friends
   friend interface IMyInterface1;  // 2863 : An interface cannot have friends
   friend void *CMyClass::f();  // 2863 : An interface cannot have friends
};