当前位置: 首页>>代码示例>>C++>>正文


C++ DynLib::getSymbol方法代码示例

本文整理汇总了C++中DynLib::getSymbol方法的典型用法代码示例。如果您正苦于以下问题:C++ DynLib::getSymbol方法的具体用法?C++ DynLib::getSymbol怎么用?C++ DynLib::getSymbol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DynLib的用法示例。


在下文中一共展示了DynLib::getSymbol方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loadPlugin

	bool PluginManager::loadPlugin(const std::string& _file)
	{
#ifdef EMSCRIPTEN
		return false;
#endif
		MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " used but not initialised");

		// Load plugin library
		DynLib* lib = DynLibManager::getInstance().load(_file);
		if (!lib)
		{
			MYGUI_LOG(Error, "Plugin '" << _file << "' not found");
			return false;
		}

		// Call startup function
		DLL_START_PLUGIN pFunc = reinterpret_cast<DLL_START_PLUGIN>(lib->getSymbol("dllStartPlugin"));
		if (!pFunc)
		{
			MYGUI_LOG(Error, "Cannot find symbol 'dllStartPlugin' in library " << _file);
			return false;
		}

		// Store for later unload
		mLibs[_file] = lib;

		// This must call installPlugin
		pFunc();

		return true;
	}
开发者ID:MyGUI,项目名称:mygui,代码行数:31,代码来源:MyGUI_PluginManager.cpp

示例2: start_func

Plugin *
PluginManager::load(std::string const & path)
{
  if (!initialized)
  {
    std::cerr << "PluginManager: Manager not initialized" << std::endl;
    return NULL;
  }

  if (dynlibs.find(path) != dynlibs.end()) return NULL;

  DynLib * dynlib = DynLibManager::load(path);
  dynlibs[path] = dynlib;

  SNL_DLL_START_PLUGIN start_func = (SNL_DLL_START_PLUGIN)dynlib->getSymbol("dllStartPlugin");
  return start_func();  // this must call install(), which adds the plugin to the installed list
}
开发者ID:hitsjt,项目名称:BetaShapeMachine,代码行数:17,代码来源:Plugin.cpp

示例3: loadPlugin

    //-----------------------------------------------------------------------
	void Root::loadPlugin(const String& pluginName)
	{
		// Load plugin library
        DynLib* lib = DynLibManager::getSingleton().load( pluginName );
		// Store for later unload
		mPluginLibs.push_back(lib);

		// Call startup function
		DLL_START_PLUGIN pFunc = (DLL_START_PLUGIN)lib->getSymbol("dllStartPlugin");

		if (!pFunc)
			OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot find symbol dllStartPlugin in library " + pluginName,
				"Root::loadPlugin");

		// This must call installPlugin
		pFunc();

	}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:19,代码来源:OgreRoot.cpp

示例4: loadPlugin

//-------------------------------------------------------------------------------//
void Root::loadPlugin(const String& pluginName)
{
    DynLib* lib = TITAN_NEW DynLib(pluginName);
    lib->load();

    if (std::find(mDynLibVector.begin(), mDynLibVector.end(), lib) == mDynLibVector.end())
    {
        mDynLibVector.push_back(lib);

        // Call startup function
        DLL_START_PLUGIN pFunc = (DLL_START_PLUGIN)lib->getSymbol("dllStartPlugin");

        if (!pFunc)
            TITAN_EXCEPT_FILELOST("Cannot find symbol dllStartPlugin in library " + pluginName);

        // This must call installPlugin
        pFunc();
    }
}
开发者ID:cty41,项目名称:Titan,代码行数:20,代码来源:TiRoot.cpp


注:本文中的DynLib::getSymbol方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。