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.

38 lines
942 B

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1998
  6. //
  7. // File: dynamlnk.h
  8. //
  9. //--------------------------------------------------------------------------
  10. // DynamLnk.h : Base class for DLLs which are loaded only when needed
  11. #ifndef __DYNAMLNK_H_INCLUDED__
  12. #define __DYNAMLNK_H_INCLUDED__
  13. class DynamicDLL
  14. {
  15. public:
  16. // These strings must remain unchanged until the FileServiceProvider is released
  17. DynamicDLL(LPCTSTR ptchLibraryName, LPCSTR* apchFunctionNames);
  18. virtual ~DynamicDLL();
  19. BOOL LoadFunctionPointers();
  20. void Unload();
  21. FARPROC QueryFunctionPtr(INT i) const;
  22. inline FARPROC operator[] (INT i) const
  23. { return QueryFunctionPtr(i); }
  24. private:
  25. HMODULE m_hLibrary;
  26. FARPROC* m_apfFunctions;
  27. LPCTSTR m_ptchLibraryName;
  28. LPCSTR* m_apchFunctionNames;
  29. INT m_nNumFunctions;
  30. };
  31. #endif // ~__DYNAMLNK_H_INCLUDED__