This ensures that your calling convention is the one used by COM. When you are writing a COM server, you normally use STDMETHOD to declare methods exposed to COM and STDMETHODIMP to implement them.
E.g
*.idl
interface IWhatever
{
HRESULT Method(params);
};
*.h
class IWhateverImpl : ...
{
...
STDMETHOD(Method)(params);
...
};
*.cpp
STDMETHODIMP IWhateverImpl::Method(params)
{
...
}
Goran.