I have a C++ class, that may optionally support some additional functionality (defined by abstract interfaces).
In Microsoft COM there is a way to ask a class for such functionality by using QueryInterface(GUID, void**). This requires to reinterpret_cast all interfaces to void*. My question is – is there a safer way to achieve the same without using cast?
I have a C++ class, that may optionally support some additional functionality (defined by
Share
COM has the requirement of obtaining any interface from any other supported by an object. You don’t have to live by that requirement. Just add getters to every interface you would expect to support.