Home > Software engineering >  How to use the new version of the COM components to replace the old version of the COM components wi
How to use the new version of the COM components to replace the old version of the COM components wi

Time:11-02

Question details:
Now have an old version of the application using the old version of the COM component, now want to do a new version of the COM component, entirely replace the old version of the COM, did not alter the content of the original application, whether can realize the original application directly using the new version of the COM component to achieve its original function?

CodePudding user response:

COM components to upgrade, usually in the old interface remains the same, increase the new interface, different IID
In this way, the old program and new applications can be peaceful, even new application can be mixed old and new interfaces use
Old program, only know that old IID, so can only use the old interface

CodePudding user response:

Well! I want to realize the direct calls to the new version of the original application of COM component and cast it away to use the old version of the COM component, don't know if this can achieve?

CodePudding user response:

If only function strengthen, interface does not change, can be directly replace COM components into the latest version

CodePudding user response:

Created using ATL COM components, can will have been using the clsids components for another component to use, and then the application does not make any change on call the new components?

CodePudding user response:

Use your new COM components, and then registered to its original clsids go above,
If you use the COM component provides registration method, you need to make a copy of the original clsids on new projects,

If using ATL, the easiest way is that the original project. The IDL is copied to the new project,
Such interface definition and coclass is consistent,
  • Related