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.

41 lines
987 B

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 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. #if _MSC_VER >= 1000 // VC 5.0 or later
  14. #pragma once
  15. #endif
  16. class DynamicDLL
  17. {
  18. public:
  19. // These strings must remain unchanged until the FileServiceProvider is released
  20. DynamicDLL(LPCTSTR ptchLibraryName, LPCSTR* apchFunctionNames);
  21. virtual ~DynamicDLL();
  22. BOOL LoadFunctionPointers();
  23. FARPROC QueryFunctionPtr(INT i) const;
  24. inline FARPROC operator[] (INT i) const
  25. { return QueryFunctionPtr(i); }
  26. private:
  27. HMODULE m_hLibrary;
  28. FARPROC* m_apfFunctions;
  29. LPCTSTR m_ptchLibraryName;
  30. LPCSTR* m_apchFunctionNames;
  31. INT m_nNumFunctions;
  32. };
  33. #endif // ~__DYNAMLNK_H_INCLUDED__