| 675 | } |
| 676 | |
| 677 | tstring PluginList::getPluginName(tstring pluginFilename) |
| 678 | { |
| 679 | HINSTANCE pluginInstance = ::LoadLibrary(pluginFilename.c_str()); |
| 680 | if (pluginInstance) |
| 681 | { |
| 682 | PFUNCISUNICODE pFuncIsUnicode = (PFUNCISUNICODE)GetProcAddress(pluginInstance, "isUnicode"); |
| 683 | BOOL isUnicode; |
| 684 | if (!pFuncIsUnicode || !pFuncIsUnicode()) |
| 685 | isUnicode = FALSE; |
| 686 | else |
| 687 | isUnicode = TRUE; |
| 688 | |
| 689 | PFUNCGETNAME pFuncGetName = (PFUNCGETNAME)GetProcAddress(pluginInstance, "getName"); |
| 690 | if (pFuncGetName) |
| 691 | { |
| 692 | CONST TCHAR* pluginName = pFuncGetName(); |
| 693 | if (pluginName) |
| 694 | { |
| 695 | tstring tpluginName = pluginName; |
| 696 | tstring::size_type ampPosition = tpluginName.find(_T("&")); |
| 697 | while(ampPosition != tstring::npos) |
| 698 | { |
| 699 | tpluginName.replace(ampPosition, 1, _T("")); |
| 700 | ampPosition = tpluginName.find(_T("&")); |
| 701 | } |
| 702 | |
| 703 | ::FreeLibrary(pluginInstance); |
| 704 | |
| 705 | return tpluginName; |
| 706 | } |
| 707 | else |
| 708 | { |
| 709 | ::FreeLibrary(pluginInstance); |
| 710 | return _T(""); |
| 711 | } |
| 712 | |
| 713 | } |
| 714 | else |
| 715 | { |
| 716 | ::FreeLibrary(pluginInstance); |
| 717 | throw tstring(_T("Plugin name call not defined")); |
| 718 | } |
| 719 | } |
| 720 | else |
| 721 | { |
| 722 | throw tstring(_T("Load library failed")); |
| 723 | } |
| 724 | |
| 725 | } |
| 726 | |
| 727 | BOOL PluginList::setInstalledVersion(tstring pluginFilename, Plugin* plugin) |
| 728 | { |