Interface Design Rules
This section is a short summary of interface design rules. For details of
custom interface design, refer to
Writing a Custom Interface.
An object is not, by definition, a COM object unless it implements at least
one interface. That interface must be IUnknown or an
interface that is derived from IUnknown. In addition, the following
rules apply to all interfaces implemented on a COM object:
-
They must directly or indirectly inherit the methods of IUnknown.
-
They must have a unique interface identifier.
-
They must be immutable: once they are created and published, no part of their
definition may change.
-
All interface methods should have a return type of HRESULT so the
portions of the system that handle remote processing can report RPC errors.
-
All string parameters in interface methods should be Unicode.