Sdílet prostřednictvím


Chyba kompilátoru C3707

'function' : dispinterface metoda musí mít dispid

Poznámky

Pokud používáte metodudispinterface, musíte ji přiřadit .dispid Pokud chcete tuto chybu opravit, přiřaďte dispid metodě dispinterface, například tím, že odkomentujete atribut id na metodě v následujícím příkladu. Další informace najdete v atributech dispinterface a ID.

Example

Následující příklad generuje C3707:

// C3707.cpp
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>

[module(name="xx")];
[dispinterface]
__interface IEvents : IDispatch
{
   HRESULT event1([in] int i);   // C3707
   // try the following line instead
   // [id(1)] HRESULT event1([in] int i);
};

int main() {
}