Upgrading a COM interface
-
Hi, I need to add a new method to my COM object. Should I create a new COM object which aggregates the first and contains the new method? Or is it OK to add a new method to an existing COM object? Jeremy. Jeremy Pullicino C++ Developer Homepage
-
Hi, I need to add a new method to my COM object. Should I create a new COM object which aggregates the first and contains the new method? Or is it OK to add a new method to an existing COM object? Jeremy. Jeremy Pullicino C++ Developer Homepage
Hi ,:) Well it depends that how is ur COM object being used ,if ur object has been aggregated by some other client using its typelibs, or some other COM object has derived ur interface to write its own functionality in the existing method , then in that case if u will add Methos in the same interface , other clients of your COM object will stop working coz of changed interface , changed typelibs thats is where comes Versioning . But if these are not the cases and u r just working on one client .then adding one more method will not create any problem. well i know that much only :-O Regards :) Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)
-
Hi, I need to add a new method to my COM object. Should I create a new COM object which aggregates the first and contains the new method? Or is it OK to add a new method to an existing COM object? Jeremy. Jeremy Pullicino C++ Developer Homepage
Strictly, you want to add a method to an interface. You don't need to create a new object, but you almost certainly want to contain a new interface. If you're using ATL, this is almost trivial (amend the IDL, specify the new interface as deriving from the old one, and add the method; amend the declaration and definition of your class by having it derive from the new interface not the old one, amend any IDispatchImpl declaration to support the new interface rather than the old, add the interface into the interface map). If you haven't published the interface (ie the client and server are not yet released) you can just amend the interface. Steve S