Page 1 of 1

COM Interface Questions

Posted: Mon Mar 12, 2018 7:42 pm
by mgrochowalski
First, how should I reference count IBaseObject? When is the reference count incremented and decremented?
It looks like the examples call QueryInterface (which should increment the reference count) but then decrement it again within the New() function. The base object is then used without a proper reference through the life of the ISimObject.

Second, are any future updates planned for the v3 SDK? It would be nice if the "LPCTSTR" types were corrected to be const char*. I spent a decent bit of time wondering why my aircraft wasn't showing up until I realized that I needed to change from the default Unicode to Multi-Byte. I do see this appears to be fixed in the v4 SDK.

Third, it would be nice if the GUIDs for the interface were defined in such a way that __uuidof() would work so that the templated QueryInterface() as well as the WRL would work.