COM object references

My book mentions something about COM object references being naked? What does that mean? It contains nothing? Its empty?

"WinRT Objects

WinRT is an object-oriented API where the objects are similar to Component Object Model (COM) objects. COM provides a mechanism for defi ning objects that can be accessed and operated on in different programming languages. A COM object is a rather different entity from the C++ class objects you have been using up to now. You cannot store a COM object in a variable; you can only store a reference to it. COM objects are reference counted, which means that a record of the number of separate references to an object is maintained. When the reference count for a COM object reaches zero, it will be destroyed and any resources the object owns will be released. If you use naked COM object references, you are responsible to call functions at the appropriate times to keep the reference count correct. However, in WinRT, you are not using naked COM objects; WinRT objects have the management of their reference counts built-in. This means that while WinRT objects are created on the heap, you don’t have to worry about deleting them because they take care of their own destruction automatically."


Also quick other question from this other paragraph:

"All data that you pass to, or receive from, the WinRT must be WinRT objects. Data of any of the fundamental C++ types will be converted to the equivalent WinRT type automatically, so you can always use C++ fundamental types in your Windows 8 apps. The WinRT types corresponding to C++ fundamental types are referred to as value types because they have pass-by-value semantics. You cannot pass objects of standard C++ class types to WinRT components. You must use WinRT"

So by pass-by-value semantics it means that whenever it passed from WinRT or to the WinRT it is always passed by value?
Last edited on
Naked in this context just means using COM directly without some kind of wrapper. WinRT (whatever that is), appears to act as a COM wrapper.
Oh ok thanks
Topic archived. No new replies allowed.