diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-08-27 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:54 +0300 |
commit | 051769bbc577aeede90558b6ab5c9be187940ca0 (patch) | |
tree | e6330cb80f2d4a526d8aa27812528e053b0cda90 /CPP/7zip/UI/FileManager/PluginLoader.h | |
parent | 33ccab7e728a996800e166d849fe1e92a17e1afe (diff) |
4.53 beta
Diffstat (limited to 'CPP/7zip/UI/FileManager/PluginLoader.h')
-rwxr-xr-x | CPP/7zip/UI/FileManager/PluginLoader.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/CPP/7zip/UI/FileManager/PluginLoader.h b/CPP/7zip/UI/FileManager/PluginLoader.h new file mode 100755 index 00000000..598a874b --- /dev/null +++ b/CPP/7zip/UI/FileManager/PluginLoader.h @@ -0,0 +1,32 @@ +// PluginLoader.h + +#ifndef __PLUGINLOADER_H +#define __PLUGINLOADER_H + +#include "Windows/DLL.h" + +typedef UINT32 (WINAPI * CreateObjectPointer)( + const GUID *clsID, + const GUID *interfaceID, + void **outObject); + +class CPluginLibrary: public NWindows::NDLL::CLibrary +{ +public: + HRESULT CreateManager(REFGUID clsID, IFolderManager **manager) + { + CreateObjectPointer createObject = (CreateObjectPointer) + GetProcAddress("CreateObject"); + if (createObject == NULL) + return GetLastError(); + return createObject(&clsID, &IID_IFolderManager, (void **)manager); + } + HRESULT LoadAndCreateManager(LPCWSTR filePath, REFGUID clsID, IFolderManager **manager) + { + if (!Load(filePath)) + return GetLastError(); + return CreateManager(clsID, manager); + } +}; + +#endif |