You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
//////////////////////////////////////////////////////////////////////////////
|
|
//文件 PluginServer.h
|
|
//主要功能:
|
|
//
|
|
//程序编写: 2009-4-1
|
|
//
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
#include "dfPluginBase.h"
|
|
#include "LoadLibrary.h"
|
|
|
|
namespace NPluginFormat
|
|
{
|
|
|
|
class AFX_EXT_CLASS CPluginServer
|
|
{
|
|
public:
|
|
CPluginServer(void);
|
|
virtual ~CPluginServer(void);
|
|
|
|
class CPluginItem : public CLoadLibrary
|
|
{
|
|
public:
|
|
CPluginItem(void);
|
|
|
|
int GetFormatCount(void); //获得插件中支持的格式个数
|
|
|
|
CPluginFormatBase* m_pFormat; //利用funGetPluginInfo函数将获得的参数保存在该变量中
|
|
DF_GET_PLUGIN_FORMAT funGetPluginFormat;
|
|
};
|
|
|
|
int LoadAllPlugins(LPCTSTR lpszPath);
|
|
int LoadPlugin(CPluginItem& item, LPCTSTR lpszFileName);
|
|
void UnloadAllPlugins(void);
|
|
|
|
CList<CPluginItem*, CPluginItem*> m_pluginList;
|
|
CPluginItem* FindFormat(LPCTSTR strExt);
|
|
CPluginServer::CPluginItem* GetItem(int nIndex);
|
|
|
|
int ReadFile(LPCTSTR lpszFileName);
|
|
int ReadFile(LPCTSTR lpszFileName, CPluginItem* pItem, int nSubDocType=0); //按照指定的格式读取,当一个种包含多种格式时nSubDocType为其索引号
|
|
|
|
INT_PTR FileDialog( BOOL bOpenFileDialog, CString strTitle, CString& fileName, int& nDocType, int& nSubDocType,
|
|
DWORD lFlags=OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT);
|
|
int GetFormatCount(void);
|
|
};
|
|
|
|
};
|
|
|
|
using namespace NPluginFormat;
|