When to change the GUID in a type library

I know that when you add / change / delete methods in the COM interface, you have to change the GUID of the / coclass interface, but what about type libraries. When should you change the type library GUID? Do you change it if the GUID inside the type library has changed? Or you should change it only when something that does not have its own GUID in the type library changes.

+3
source share
2 answers

The basic principle is that COM interfaces and type libraries should be immutable (that is, they should never change). If you change one element inside the COM interface, then the new version should be a completely separate entity from the previous version. The only way to do this is to change the GUID for each interface in the library and the GUID for the type library itself. It is also a good idea (for your own personal reason) to change the name of the type library.

Ideally, you should never change the COM interface. Instead, create a new derived COM interface and publish it to a new type library.

+3
source

I have a similar question.

I had an original control with CLSID_A that implemented the IID_A interface in some 1.0 type library with GUID_A

. IID_A IID_B. , , , CLSID, , typelib. V++ -- , QueryInterface typelib. CLSID, CoCreated... Queried ...

, , LabVIEW , Microsoft.NET, MFC, , , .

GUID. , ? , : , . , M $ .

0

Source: https://habr.com/ru/post/1699522/


All Articles