.NET COM component to replace existing
-
I've just been handed the task of replacing an existing COM component. It has to stay as a COM component as we have no ability to change the caller. It has to able to call a COM component, that again we can't alter. i.e. where changing the middle part of an existing process and have to do so transparently. I've been doing some background research, and it looks like I can create a .NET COM component easy enough. :thumbsup: I've got a few q's though. When you create the COM interface and class they have GUID's, do these GUID's have to match the existing COM component? Or is it when the caller makes the COM call the OS:confused: determines the component based on name? Another requirement is that the final COM call is 'dynamic' in that the method name we have to call might change, assuming the method will act on the same data is this doable?
-
I've just been handed the task of replacing an existing COM component. It has to stay as a COM component as we have no ability to change the caller. It has to able to call a COM component, that again we can't alter. i.e. where changing the middle part of an existing process and have to do so transparently. I've been doing some background research, and it looks like I can create a .NET COM component easy enough. :thumbsup: I've got a few q's though. When you create the COM interface and class they have GUID's, do these GUID's have to match the existing COM component? Or is it when the caller makes the COM call the OS:confused: determines the component based on name? Another requirement is that the final COM call is 'dynamic' in that the method name we have to call might change, assuming the method will act on the same data is this doable?
To differentiate between various COM components and Interfaces, GUIDs have to be unique. They should not match other COM components. Didn't understand your requirement of "final COM call is 'dynamic'"
-
To differentiate between various COM components and Interfaces, GUIDs have to be unique. They should not match other COM components. Didn't understand your requirement of "final COM call is 'dynamic'"
Thanks, Regarding the last bit, I have to call another third-party COM component. But as the third-party app might be replaced, if possible I'd like to be able to configure the name of the component and method called? (assuming the new and old method are similar in parameters etc)
-
Thanks, Regarding the last bit, I have to call another third-party COM component. But as the third-party app might be replaced, if possible I'd like to be able to configure the name of the component and method called? (assuming the new and old method are similar in parameters etc)
There are two scenarios: 1. Replace the 3rd party COM component and consequently use a different COM Interface (with a different signature). This scenario is independent of COM programming. I would use Adaptor design pattern for this problem. 2. Replace the 3rd party COM component but use same COM Interface (i.e. the Interface's GUID is same). In this case there will be no change in your program. All you need to do is to unregister the old COM server and register the new COM server.