#pragma once //////////////////////////////////////////////////////////////////////////// // DllLoader.h : Test-Driver-DLL loader that uses ITests.h as protocole // // ver 1.1 // // // // Application : OOD F18 Project 2 Help // // Platform : VS17 Community - Windows 10 Professional x64 // // Author : Ammar Salman, EECS Department, Syracuse University // // 313/788-4694, hoplite.90@hotmail.com // //////////////////////////////////////////////////////////////////////////// /* * Package description: * ====================== * This package loads Test-Driver DLLs that follow the ITests protocole * defined in ITests.h * * The protocol forces all TestDrivers to have an implementation of ITests * interface which holds a collection of ITest pointers. This package will * attempt to load the DLL, get an instance of ITests* and retrieve the * std::vector contained within the DLL. * * Required files: * ================= * ITests.h DllLoader.h DllLoader.cpp * Note: nothing else is needed since this will load the DLLs at RUNTIME. * * Maintainence History: * ======================= * ver 1.1 : 27 Sep 2018 : Jim Fawcett * - demonstrate some options for converting strings * ver 1.0 : 24 Sep 2018 : Ammar Salman * - first release */ #include "../ITests.h" #include #include class DllLoader { public: DllLoader(); ~DllLoader(); bool loadAndExtract(const std::string& dll); const std::vector& tests() const; void clear(); // unloads the DLL (if loaded) and clears all extracted tests private: std::vector extractedTests; // contains the set of tests extracted from the TestDriver DLL HMODULE hmod; // handle to the loaded DLL };