The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

69 lines
2.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-7 by Raw Material Software ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the
  7. GNU General Public License, as published by the Free Software Foundation;
  8. either version 2 of the License, or (at your option) any later version.
  9. JUCE is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with JUCE; if not, visit www.gnu.org/licenses or write to the
  15. Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  16. Boston, MA 02111-1307 USA
  17. ------------------------------------------------------------------------------
  18. If you'd like to release a closed-source product which uses JUCE, commercial
  19. licenses are also available: visit www.rawmaterialsoftware.com/juce for
  20. more information.
  21. ==============================================================================
  22. */
  23. #ifndef __JUCE_WIN32_DYNAMICLIBRARYLOADER_JUCEHEADER__
  24. #define __JUCE_WIN32_DYNAMICLIBRARYLOADER_JUCEHEADER__
  25. #ifndef DOXYGEN
  26. //==============================================================================
  27. // use with DynamicLibraryLoader to simplify importing functions
  28. //
  29. // functionName: function to import
  30. // localFunctionName: name you want to use to actually call it (must be different)
  31. // returnType: the return type
  32. // object: the DynamicLibraryLoader to use
  33. // params: list of params (bracketed)
  34. //
  35. #define DynamicLibraryImport(functionName, localFunctionName, returnType, object, params) \
  36. typedef returnType (WINAPI *type##localFunctionName) params; \
  37. type##localFunctionName localFunctionName \
  38. = (type##localFunctionName)object.findProcAddress (#functionName);
  39. //==============================================================================
  40. // loads and unloads a DLL automatically
  41. class JUCE_API DynamicLibraryLoader
  42. {
  43. public:
  44. DynamicLibraryLoader (const String& name);
  45. ~DynamicLibraryLoader();
  46. void* findProcAddress (const String& functionName);
  47. private:
  48. void* libHandle;
  49. };
  50. #endif
  51. #endif // __JUCE_WIN32_DYNAMICLIBRARYLOADER_JUCEHEADER__