Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 993 Bytes

compiler-error-c3707.md

File metadata and controls

34 lines (28 loc) · 993 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3707
Compiler Error C3707
11/04/2016
C3707
C3707
ac63a5dd-7a4b-48d2-9f2a-be9cb090134c

Compiler Error C3707

'function' : dispinterface method must have a dispid

If you use a dispinterface method, you must assign it a dispid. To fix this error, assign a dispid to the dispinterface method, for example, by uncommenting the id attribute on the method in the sample below. For more information, see the attributes dispinterface and id.

The following sample generates 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() {
}