Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PluginLoader.h « FileManager « UI « 7zip « CPP - github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fed38d6515fb33fc6b7625153a9f6304044d207a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// PluginLoader.h

#ifndef __PLUGIN_LOADER_H
#define __PLUGIN_LOADER_H

#include "../../../Windows/DLL.h"

#include "IFolder.h"

class CPluginLibrary: public NWindows::NDLL::CLibrary
{
public:
  HRESULT CreateManager(REFGUID clsID, IFolderManager **manager)
  {
    Func_CreateObject createObject = (Func_CreateObject)GetProc("CreateObject");
    if (!createObject)
      return GetLastError();
    return createObject(&clsID, &IID_IFolderManager, (void **)manager);
  }
  HRESULT LoadAndCreateManager(CFSTR filePath, REFGUID clsID, IFolderManager **manager)
  {
    if (!Load(filePath))
      return GetLastError();
    return CreateManager(clsID, manager);
  }
};

#endif