0

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?

Martin
  • 5,945
  • 7
  • 50
  • 77
  • 1
    It is a bit clumsily stated, what they are trying to tell you that you'll have no hope of using the interface from, say, a scripting client. It is not an IDispatch interface and there's no type library for it. Only a C++ program will have an easy time using it. You can only get the definition by #including vbackup.h and it is written using the *class* keyword. That doesn't make it completely impossible to use it in another language, C# could do it for example, but you'd have to carefully write the interface declaration to match. Not otherwise unusual. – Hans Passant May 19 '19 at 02:37
  • https://stackoverflow.com/a/19719715/17034 – Hans Passant May 19 '19 at 02:39

1 Answers1

0

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.

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298