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 C2861

'function name' : an interface member function cannot be defined

The compiler encountered the interface keyword or deduced a struct as an interface but then found a member function definition.

Example

// Example: 
//
#pragma keyword("interface", on)  

#include <objbase.h>              //    required for IUnknown definition
#undef interface                  //    required - header #define's interface.

interface IMyInterface : IUnknown {
   HRESULT mf(int a); 
};

HRESULT IMyInterface::mf(int a)   
{                                  // error
   if (a > 0) 
      return S_OK;
   else
      return E_FAIL;
}