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

  • Home
  • SEARCH
  • 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 1089357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:12:35+00:00 2026-05-16T23:12:35+00:00

Essentially, how to write a plugin system, where each plugin is a DLL. (Or

  • 0

Essentially, how to write a plugin system, where each plugin is a DLL. (Or is there a better way of a plugin system where each plugin is written natively?)

Suppose that each DLL offers some functionality available to other plugins. If plugin A does provides FuncA and plugin B wants FuncA, how should dependency be managed? How should plugins be identified (GUIDS?) How should be DLLs loaded? How should the function be called?

I’m not familiar with DLLs, and I am asking on the scope of Windows API calls that would enable a sane way to achieve this.

  • 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-05-16T23:12:35+00:00Added an answer on May 16, 2026 at 11:12 pm

    Have your DLL export a function returning meta information about the plugin itself, i.e. version, dependencies, exported features etc. When walking over a plugin directory, dynamically load the DLLs in that directory via LoadLibrary and check if they export a symbol that matches your query function (via GetProcAddress). If so, load the DLL, try to query the plugin and get some meaningful information out of it.

    Be sure to employ some kind of version management for your plugin system, to accommodate for API changes. Windows itself does it by passing version information (sometimes in the form of struct sizes) to certain functions.

    As for dependencies, build a dependency graph. If you detect a circular dependency (for example using Floyd’s algorithm), ask the user what to do, i.e. what plugin to disable. If there are no cycles in your graph, you can traverse the (directed) graph to determine a load order for plugins.

    Edit, as per your question in the comment:

    How would DLL1 call a function that it
    expects in DLL2? I’m guessing the
    plugin framework would need to provide
    something like
    GetPluginFuncAddr(plugin_ID, func_ID)
    […]

    Yes, you could expose a function like this, or provide access to some sort of globally accessible registry. Again, I would advise to include versioning, so plugins can optionally ask for a specific version of a function that is known to work, allowing updates without breaking existing plugins.

    how should plugins and functions be
    identified? Strings vs GUIDs, or is
    this a trivial thing since a plugin
    should just provide headers?

    See, if you are developing a plugin using features/functions of another plugin, you probably don’t want to do the plugin loading, version/compatiblity checking and error handling each time you write a plugin, instead, you’d probably expect to link against a stub that does the boilerplate stuff for you. As for how you implement plugin and function identification really is up to you. GUIDs sure are not a bad idea when it comes to identifying a plugin (together with a user-friendly, human readable name and description), apart from that, you can offer a list/tree of different feature versions, i.e.

    UsefulPlugin@{1e2f253e-a3b2-4617-90f2-f323577ffddf}
    |
    \__ FunctionA
    | |
    | \_ v1.1
    | |
    | \_ v1.3
    |
    \__ FunctionB
      |
      \_ v1.0
    

    …which clients can query for needed information. If you want, you can even offer a reflection-kind of information, providing information about parameters, return values and the like of your function.

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

Sidebar

Related Questions

Essentially, is there any way to make this code legal? main = print .
I have to write an application that is essentially a proxy server to handle
I'm trying to write a regular expression that will essentially return true if string
I'm wondering if there's any way to populate a dictionary such that you have
I'm trying to write code that will traverse an undirected, unweighted graph. Essentially, the
There are essentially to ways to write an XSD: 1.) Use one single element
I'm trying to write some generic structures. Essentially, what I need for my purpose
I'm looking to write some C# that will detect a piece of a URL
Essentially, I'm looking for a 1D bar-code scanner that I can program, either through
Essentially, I have a binary voting system Like/Dislike. Thee class is called Like It

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.