// 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) 
#using <mscorlib.dll>

using namespace System;

#using "Data.dll"

extern "C"
{
#include "thirdparty.h"
}

namespace E
{
    public ref class Wrapper
    {
        private:
            static CallBack^ cb;
        public:
            static void Real(pfoobar unmgfb);
            static void Passthrough(CallBack^ cb);
    };
    void RealReal(pfoobar unmgfb)
    {
        Wrapper::Real(unmgfb);
    }
    void Wrapper::Passthrough(CallBack^ cb)
    {
        Wrapper::cb = cb;
        test(RealReal);
    }
    void Wrapper::Real(pfoobar unmgfb)
    {
        FooBar mgfb;
        mgfb.iv = unmgfb->iv;
        mgfb.xv = unmgfb->xv;
        mgfb.sv = gcnew String(unmgfb->sv);
        cb(mgfb);
    }
}
