title: How do you expose functionality to a plugin library?
body: <p>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?</p>
  
  <p>EDIT: Here's more of what I'm trying to do:</p>
  
  <pre><code>
  //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?
      }
  };
  </code></pre>