mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-12 16:11:35 -06:00
3.13
This commit is contained in:
34
7zip/FileManager/PluginLoader.h
Executable file
34
7zip/FileManager/PluginLoader.h
Executable file
@@ -0,0 +1,34 @@
|
||||
// PluginLoader.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#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(LPCTSTR filePath, REFGUID clsID, IFolderManager **manager)
|
||||
{
|
||||
if (!Load(filePath))
|
||||
return GetLastError();
|
||||
return CreateManager(clsID, manager);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user