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() {
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for