#pragma once

#include "Array.h"
#include "Critical.h"
#include "ReferenceCounter.h"

namespace Framework
{
    struct DLLFile
    {
        Text* name;
        HINSTANCE handle;
        int ref;
    };

    class DLLRegister : public virtual ReferenceCounter
    {
    private:
        Array<DLLFile*>* dlls;
        Critical cs;

    public:
        //! Constructor
        __declspec(dllexport) DLLRegister();
        //! Destructor
        DLLEXPORT ~DLLRegister();
        //! non-constant
        DLLEXPORT HINSTANCE loadDLL(const char* name, const char* pfad);
        DLLEXPORT void releaseDLL(const char* name);
    };
} // namespace Framework