Delen via


Compilerfout C3761

'function': 'retval' kan alleen worden weergegeven op het laatste argument van een functie

Opmerkingen

Het kenmerk retval is gebruikt voor een functieargument dat niet het laatste argument in de lijst was.

Example

In het volgende voorbeeld wordt C3761 gegenereerd:

// C3761.cpp
#define _ATL_ATTRIBUTES 1
#include <atlbase.h>
#include <atlcom.h>

[ module(name=test) ];

[dispinterface]
__interface I
{
   [id(1)] HRESULT func([out, retval] int* i, [in] int j);
   // try the following line instead
   // [id(1)] HRESULT func([in] int i, [out, retval] int* j);
};

[coclass]
struct C : I {   // C3761
   HRESULT func(int* i, int j)
   // try the following line instead
   // HRESULT func(int j, int* i)
   {
      return S_OK;
   }
};

int main()
{
}