Published by Roman on 29 Jan 2007
Visual Studio .NET 2005 C++/ATL attribute provider
Does it make sense that __event __interface may still only use dispinterface defined in this module and not imported?
#import “libid:…” no_namespace raw_interfaces_only raw_dispinterfaces
[
coclass,
event_source(com),
default(IFoo, _FooEvents),
...
]
class ATL_NO_VTABLE CFoo :
public IFoo
{
public:__event __interface _FooEvents; // Imported using #import
…
OK, in Visual Studio .NET 2002 the attribute provider only appeared first, this could be a problem missed while developing the stuff. 2003 version did not fix the issue. In 2005 it’s still the problem!
error C3706: ‘_FooEvents’: must be a COM interface to fire COM events
error C3335: ‘_FooEvents’: There can be at most one default interface for a coclass ‘CFoo’


