treating structure as an interface
The compiler regards a struct with an associated uuid (specified with declspec(uuid("..."))
) and a single base class that is also an interface (except for a struct by the name of IUnknown, which does not inherit an interface) as an interface.
The following struct will be deduced as an interface by the compiler:
struct __declspec(uuid("{10338100-fc02-11d1-a4fe-444553540000}")) IExample : public IDispatch { public: virtual HRESULT mf1() = 0; virtual HRESULT mf2() = 0; };
It is equivalent to the following interface, written using the interface keyword and the uuid attribute:
[ uuid="10338100-fc02-11d1-a4fe-444553540000" ] interface IExample : IDispatch { HRESULT mf1(); HRESULT mf2(); };