title: What does overriding virtual function differs only by calling convention mean?
body: <p>I am trying to implement <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms680509%28v=vs.85%29.aspx" rel="noreferrer">IUnknown</a>. I followed the instruction to the tee but it isn't working. When I try to compile I get:</p>
  
  <pre><code>Error   2   error C2695: 'testInterfaceImplementation::AddRef': overriding virtual function differs from 'IUnknown::AddRef' only by calling convention  c:\users\seanm\desktop\test\test\source.cpp 6   1   test
  Error   3   error C2695: 'testInterfaceImplementation::QueryInterface': overriding virtual function differs from 'IUnknown::QueryInterface' only by calling convention  c:\users\seanm\desktop\test\test\source.cpp 14  1   test
  Error   4   error C2695: 'testInterfaceImplementation::Release': overriding virtual function differs from 'IUnknown::Release' only by calling convention    c:\users\seanm\desktop\test\test\source.cpp 22  1   test
  </code></pre>
  
  <p>from this code:</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  #include &lt;tchar.h&gt;
  
  class testInterfaceImplementation : public IUnknown {
      protected:
          ULONG AddRef() 
          {
              MessageBox(NULL,
                  _T("TEST1"),
                  _T("TEST1"),
                  NULL);
              return 0;
          }
          HRESULT QueryInterface(IN REFIID riid, OUT void **ppvObject) 
          {
              MessageBox(NULL,
                  _T("TEST2"),
                  _T("TEST2"),
                  NULL);
              return S_OK;
          }
          ULONG Release() {
              MessageBox(NULL,
                  _T("TEST3"),
                  _T("TEST3"),
                  NULL);
              return 0;
          }
  };
  </code></pre>