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.

36 lines
929 B

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2001.
  5. //
  6. // File: DynamLnk.h
  7. //
  8. // Contents: Base class for DLLs which are loaded only when needed
  9. //
  10. //----------------------------------------------------------------------------
  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(LPCWSTR ptchLibraryName, LPCSTR* apchFunctionNames);
  18. virtual ~DynamicDLL();
  19. BOOL LoadFunctionPointers();
  20. FARPROC QueryFunctionPtr(INT i) const;
  21. inline FARPROC operator[] (INT i) const
  22. { return QueryFunctionPtr(i); }
  23. private:
  24. HMODULE m_hLibrary;
  25. FARPROC* m_apfFunctions;
  26. LPCWSTR m_ptchLibraryName;
  27. LPCSTR* m_apchFunctionNames;
  28. INT m_nNumFunctions;
  29. };
  30. #endif // ~__DYNAMLNK_H_INCLUDED__