Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
608 B

  1. // Copyright (c) 1997-1999 Microsoft Corporation
  2. //
  3. // Self-freeing DLL class
  4. //
  5. // 10-9-98 sburns
  6. #ifndef SAFEDLL_HPP_INCLUDED
  7. #define SAFEDLL_HPP_INCLUDED
  8. class SafeDLL
  9. {
  10. public:
  11. // Constructs an instance that will on-demand load the named dll.
  12. //
  13. // dllName - name of the dll to be loaded.
  14. explicit
  15. SafeDLL(const String& dllName);
  16. // calls FreeLibrary on the DLL
  17. ~SafeDLL();
  18. HRESULT
  19. GetProcAddress(const String& functionName, FARPROC& result) const;
  20. private:
  21. mutable HMODULE module;
  22. String name;
  23. };
  24. #endif // SAFEDLL_HPP_INCLUDED