Search code examples
visual-c++comvolume-shadow-service

What is distinction between a C++ and COM interface for IVssExamineWriterMetadata?


According to https://learn.microsoft.com/en-us/windows/desktop/api/vsbackup/nl-vsbackup-ivssexaminewritermetadata:

The IVssExamineWriterMetadata interface is a C++ (not COM) interface that allows a requester to examine the metadata of a specific writer instance. This metadata may come from a currently executing (live) writer, or it may have been stored as an XML document.

All the code I see treats it like a COM interface.

The definition looks like COM to me.

https://github.com/candera/hobocopy/blob/master/inc/winxp/vsbackup.h#L91

What is the distinction here? Does it violate the COM interface design rules in some documented way?


Solution

  • My guess is the guy(s) who wrote this code, file and the associated doc probably didn't know what COM is, so they brought their own confusion in.

    For example, they use a combination of BSTR (Automation) and LPCWSTR (raw) argument types, in the same interface (IVssBackupComponents for exemple), which is very odd.

    This is COM, raw COM, because COM is essentially very simple. You can define a COM vtable in many ways, with any language, this is the beauty of it (not talking of IDispatch, type libraries, MIDL, threading, registry, class factories, out-of-process, marshaling, etc.).

    For another raw COM example, look at DirectX: Programming DirectX with COM is well written and talks about what they call "raw COM" is.