Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 861 Bytes

compiler-error-c3732.md

File metadata and controls

41 lines (33 loc) · 861 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3732
Compiler Error C3732
11/04/2016
C3732
C3732
2d55a7e1-9c39-4379-a093-2f7beb27e2ca

Compiler Error C3732

'interface': a custom interface that fires COM events cannot inherit from IDispatch

An interface that supports COM events cannot inherit from IDispatch. For more information, see Event Handling in COM.

The following error generates C3732:

// C3732.cpp
#define _ATL_ATTRIBUTES 1
#include "atlbase.h"
#include "atlcom.h"

[module(name="test")];

// to resolve this C3732, use dual instead of object
// or inherit from IUnknown
[ object ]
__interface I : IDispatch
{
};

[ event_source(com), coclass ]
struct A
{
   __event __interface I;   // C3732
};

int main()
{
}