// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>

using namespace std;

#include <windows.h>

#include "common.h"

typedef Foobar *(*foobarcreate)();

void test(char *dllname)
{
   HINSTANCE mydll = LoadLibrary(dllname);
   foobarcreate fbc = (foobarcreate)GetProcAddress(mydll,"CreateFoobar");
   Foobar *fb = fbc();
   cout << fb->WhoAmI() << endl;
   cout << fb->Op(8,2) << endl;
}

int main()
{
   test("a.dll");
   test("b.dll");
   return 0;
}
