1 #ifndef LIBFILEZILLA_GLUE_DLL_HEADER
2 #define LIBFILEZILLA_GLUE_DLL_HEADER
4 #include "../libfilezilla.hpp"
8 #include "./windows.hpp"
17 class FZ_PUBLIC_SYMBOL
dll final
25 explicit dll(
wchar_t const* name, DWORD flags)
27 h_ = LoadLibraryExW(name,
nullptr, flags);
38 static dll from_address(T
const& t) {
40 if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<char const*>(t), &d.h_)) {
46 dll(dll
const&) =
delete;
47 dll& operator=(dll
const&) =
delete;
50 dll& operator=(dll && d);
52 explicit operator bool()
const {
62 return h_ ?
reinterpret_cast<void*
>(::GetProcAddress(h_, name)) :
nullptr;
92 #error This file is for Windows only
dll(wchar_t const *name, DWORD flags)
Open the specified library with the passed in flags.
Definition: dll.hpp:25
void * operator[](char const *name)
Retrieves the address of an exported symbol in the library.
Definition: dll.hpp:61
dll ole32_
The Ole32 DLL.
Definition: dll.hpp:86
~dll()
Closes the library and frees related resources.
Definition: dll.hpp:31
A collection of commonly used dlls.
Definition: dll.hpp:73
dll shell32_
The Shell32 DLL.
Definition: dll.hpp:85
The namespace used by libfilezilla.
Definition: apply.hpp:17
Encapsulates a DLL.
Definition: dll.hpp:17