Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:19:53+00:00 2026-06-04T16:19:53+00:00

I have an windows application that is tightly coupled with a third party COM

  • 0

I have an windows application that is tightly coupled with a third party COM Object. And through the instance of this com object, all i am doing is create, delete, save and export. Now as new requirement arised, I have to add another similar third party component but from different vendor.

I dont want to write separate application that is similar to the first one except third party dependency changed.

How should i change my windows application so that

  1. I can easily switch these third party dependencies. (like loosely coupled kind of thing).
  2. I dont need to maintenance separate code.

I need some directions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:19:54+00:00Added an answer on June 4, 2026 at 4:19 pm

    One option (which may not be suitable for you) is to write an interface that all plugins will inherit, which contains the abstracted-out methods of what you need to achieve from each COM .dll. Then, each plugin is a C# Class Library which implements the interface, and passes off all of the calls to a Backend COM object.

    This means that you would ship 3 new DLLs, the one that contains your interface (and is referenced by the main application and the .NET Class Library), the .NET Class Library as the main ‘Plugin’, and then the backend COM .dll also.

    Like I say it’s just one way to do it, but would get you up and running pretty quick with little overhead IMO.


    Simplistic example:

    IPlugin.cs [IPlugin.dll]

    interface IPlugin
    {
        bool MethodReturningTrue();
    }
    

    YourPlugin.cs [YourPlugin.dll, references IPlugin.dll]

    class YourPlugin : IPlugin
    {
        public bool MethodReturningTrue()
        {
            return true;
        }
    }
    

    PluginHost.cs [yourapp.exe, references IPlugin.dll]

    class PluginHost
    {
        public static IPlugin GetPlugin()
        {
            Assembly asmbly = Assembly.LoadFrom("YourPlugin.dll");
            Type objectType = asmbly.GetType("YourPlugin");
            return (IPlugin)Activator.CreateInstance(objectType);
        }
    }
    

    PluginUser.cs [yourapp.exe, references IPlugin.dll]

    class PluginUser
    {
        public bool GetTrueValueFromPlugin()
        {
            IPlugin pluginObj = PluginHost.GetPlugin();
            pluginObj.MethodReturningTrue();
        }
    }
    

    Of course, that relies on the class being called “YourPlugin” within the “YourPlugin.dll”. In a production environment to support multiple .dlls you would enumerate the .dlls, load each assembly, and use Reflection to find classes within that Assembly which implement the IPlugin interface. If you need two way communications between the plugin and the host, you can make another interface (ie. IPluginHost) and add a method to IPlugin which accepts an instance of IPluginHost. The implementing classes can then store that instance and call methods to have the two way comms in place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed my windows application that uses TeeChart ActiveX (a COM Component for
I have a Windows application that exports to Excel using the Excel Object Module
I have my Windows Application that accepts args and I use this in order
I have a Windows application that utilizes a 3rd-party tool ( FaxMan ) to
i have an windows application that i have made by visual studio 2008.this application
This is strange. I have a windows application that dynamically loads DLLs using Reflection.Assembly.LoadFrom(dll_file_name_here)
We have a Windows application that can use multiple PCI adapters. These adapters all
I have a Windows Workflow application that uses classes I've written for COM automation.
I have a windows form application that uses a Shared class to house all
I have a Windows application that has 2 Forms . From one form I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.