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 6999067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:29:35+00:00 2026-05-27T20:29:35+00:00

If I have a program foo.exe and it loads a plugin bar.dll at run

  • 0

If I have a program foo.exe and it loads a plugin bar.dll at run time, how do I let the code in bar.dll use classes from foo.exe? And would it be possible for bar.dll to derive classes from foo.exe? Also, would the solution be cross-platform?

EDIT: Here’s more of what I’m trying to do:


//foo.exe
class Node {
public:
    void SetName(const string& n) { ... }
    const string& GetName() { ... }
};

//bar.dll
class TransformNode : public Node {
public:
    void DoSomething() {
        SetName(...);   //basically, can I inherit functionality from foo.exe (SetName and GetName) 
                        //and reuse the code in a derived class in bar.dll?
    }
};
  • 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-27T20:29:36+00:00Added an answer on May 27, 2026 at 8:29 pm

    In order to let bar.dll use classes from foo.exe, you need to pass an instance of a class with virtual functions from foo.exe to bar.dll. Bar.dll will call the virtual functions that came from foo.exe.


    Yes, it is possible for bar.dll to pass derived clases back to foo.exe, and then have foo.exe call the virtual functions of said classes.


    This solution would be cross-platform, but you are going to have major problems making sure you do not break abi between the shared library and the exe. Even the simplest of changes can easily break abi.

    This is a good intro to what can break an abi.

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

Sidebar

Related Questions

Let's say I have this program: class Foo { public: unsigned int bar ()
I have the following code: public class Foo {} static class Program { [XmlElement(foo)]
I would like to execute foo.bat from within a Groovy program and have the
I have these files: foo.dll foo.lib foo.exp bar.il bar.netmodule foo defines functions in its
I have a program which references a DLL. Code in this DLL gets the
I have a program 'foo' running different threads, fooT1, fooT2, .. fooTn. Now if
I have a program that uses the mt19937 random number generator from boost::random. I
Suppose I have a program A. I run it, and performs some operation starting
I have the following program module test contains subroutine foo() integer, allocatable :: a(:)
Sometimes I have a batch file like this: Action.bat : Set PATH=%PATH%;C:\Some\Folder\I\Need foo.exe Bar1

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.