MCPcopy Create free account
hub / github.com/WinMerge/winmerge / LoadPlugin

Method LoadPlugin

Src/Plugins.cpp:697–710  ·  view source on GitHub ↗

* @brief Try to load a plugin * * @return 1 if loaded plugin successfully, negatives for errors */

Source from the content-addressed store, hash-verified

695 * @return 1 if loaded plugin successfully, negatives for errors
696 */
697int PluginInfo::LoadPlugin(const String & scriptletFilepath)
698{
699 // Search for the class "WinMergeScript"
700 LPDISPATCH lpDispatch = CreateDispatchBySource(scriptletFilepath.c_str(), L"WinMergeScript");
701 if (lpDispatch == nullptr)
702 {
703 // set up object in case we need to log info
704 ScriptInfo scinfo(scriptletFilepath);
705 scinfo.Log(_T("WinMergeScript entry point not found"));
706 return -10; // error
707 }
708
709 return MakeInfo(scriptletFilepath, paths::FindFileName(scriptletFilepath), lpDispatch);
710}
711
712static void ReportPluginLoadFailure(const String & scriptletFilepath, const SE_Exception& se)
713{

Callers 1

LoadPluginWrapperFunction · 0.80

Calls 3

CreateDispatchBySourceFunction · 0.85
FindFileNameFunction · 0.85
LogMethod · 0.45

Tested by

no test coverage detected