本文整理汇总了C++中DynamicLibrary::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ DynamicLibrary::Load方法的具体用法?C++ DynamicLibrary::Load怎么用?C++ DynamicLibrary::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynamicLibrary
的用法示例。
在下文中一共展示了DynamicLibrary::Load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RegisterAllPlugins
void Application::RegisterAllPlugins()
{
std::ifstream plugins_file(cpw::ApplicationConfiguration::GetInstance()->GetPluginsFile().c_str());
if (plugins_file.is_open())
{
while (!plugins_file.eof())
{
std::string plugin;
plugins_file >> plugin;
DynamicLibrary *library = new DynamicLibrary();
if (plugin=="")
continue;
library->Load(plugin);
if (library->GetH() != NULL)
{
std::string str1;
library->RegisterPluginMenu(str1);
int id = main_frame->AddPluginMenu(str1);
plugin_map[id] = library;
}
else
if (library)
{
delete library;
library = NULL;
}
}
plugins_file.close();
}
}
示例2: LoadPlugin
Plugin* Plugin::LoadPlugin(const char* pluginFile)
{
DynamicLibrary* lib = new DynamicLibrary();
if( !lib->Load(pluginFile) )
{
delete lib;
return 0;
}
PluginAccessor accessor = (PluginAccessor)lib->FindFunction("GetPlugin");
if( !accessor )
{
delete lib;
return 0;
}
Plugin* plugin = accessor(Memory::sInstance, Assert::sInstance);
if( !plugin )
{
delete lib;
return 0;
}
plugin->SetLibrary(lib);
return plugin;
}