Ignore:
Timestamp:
Jun 14, 2006, 4:23:50 PM (15 years ago)
Author:
Eugene Romanenko
Message:

fixed SYS3180 when plugins resides not in current dir. (closes #20, #29)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/pluginman.cpp

    r35 r54  
    2222 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    2323 * in which case the provisions of the LGPL are applicable instead of those
    24  * above. If you wish to allow use of your version of this file only under the 
     24 * above. If you wish to allow use of your version of this file only under the
    2525 * terms of the LGPL, and not to allow others to use your version of this file
    2626 * under the terms of the CDDL, indicate your decision by deleting the
    2727 * provisions above and replace them with the notice and other provisions
    2828 * required by the LGPL. If you do not delete the provisions above, a recipient
    29  * may use your version of this file under the terms of any one of the CDDL 
     29 * may use your version of this file under the terms of any one of the CDDL
    3030 * or the LGPL.
    3131 *
     
    4848    // Find exe path
    4949    char buffer[ _MAX_PATH ];
     50    char path[ _MAX_PATH ];
    5051    char drive[ _MAX_DRIVE ];
    5152    char dir[ _MAX_DIR ];
    5253    _splitpath( __argv[0], drive, dir, NULL, NULL );
    53     _makepath( buffer, drive, dir, NULL, NULL );
    54     strcat( buffer, "\\LU*.DLL" );
     54    _makepath( path, drive, dir, NULL, NULL );
     55    strcpy( buffer, path );
     56    strcat( buffer, "LU*.DLL" );
    5557
    5658    // enum plugins, except for LUDOC.DLL, which is 'null' plugin
     
    6062    {
    6163        if ( stricmp( ffblk.name, "LUDOC.DLL" ) != 0 ) {
    62             loadPlugin( ffblk.name );
     64            loadPlugin( path, ffblk.name );
    6365        }
    6466        done = _dos_findnext( &ffblk );
     
    7981}
    8082
    81 void PluginManager::loadPlugin( const char *dllname )
     83void PluginManager::loadPlugin( const char *path, const char *dllname )
    8284{
    8385    // Function pointer variables
     
    8587    char * APIENTRY (*pGetSupportedExtensions)();
    8688    char * APIENTRY (*pGetDescription)();
     89
     90    std::string fulldllname = path;
     91    fulldllname += dllname;
    8792
    8893    // cut DLL name at last point
     
    95100    do
    96101    {
    97         if ( DosLoadModule( NULL, 0, dllname, &h ) != 0 )
     102        if ( DosLoadModule( NULL, 0, fulldllname.c_str(), &h ) != 0 )
    98103            break;
    99104        if ( DosQueryProcAddr( h, 0, "createObject", (PFN *)&pCreateObject ) != 0 )
     
    124129LuDocument *PluginManager::createDocumentForExt( const char *ext, bool checkOnly )
    125130{
    126         if ( ext == NULL ) {
    127                 return NULL;
    128         }
     131    if ( ext == NULL ) {
     132        return NULL;
     133    }
    129134
    130135    LuDocument * APIENTRY (*pCreateObject)();
Note: See TracChangeset for help on using the changeset viewer.