Ignore:
Timestamp:
Jan 25, 2007, 8:16:01 PM (14 years ago)
Author:
Eugene Romanenko
Message:

Show message with missed modulename if Lucide.dll cannot be loaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/lcd.c

    r138 r190  
    3434
    3535#define INCL_DOS
     36#define INCL_WIN
    3637#include <os2.h>
    3738
     39#include <stdio.h>
    3840#include <string.h>
    3941#include <process.h>
     
    5254    int result = 1;
    5355    char *last_slash;
     56    CHAR modName[ CCHMAXPATH ] = { 0 };
    5457    HMODULE hmod = NULLHANDLE;
     58    APIRET rc = 0;
    5559
    5660#ifdef __TEST__
     
    7377    DosSetExtLIBPATH( lucideDir, BEGIN_LIBPATH );
    7478
    75     if ( DosLoadModule( NULL, 0, "Lucide", &hmod ) == 0 )
     79    rc = DosLoadModule( modName, sizeof( modName ), "Lucide", &hmod );
     80    if ( rc == 0 )
    7681    {
    7782        PFN pfn = NULL;
     
    8186            result = LucideMain( argc, argv );
    8287        }
    83         DosFreeModule (hmod);
     88        DosFreeModule( hmod );
     89    }
     90    else
     91    {
     92        HAB hab;
     93        HMQ hmq;
     94        char msg[ 256 ];
     95
     96        hab = WinInitialize( 0 );
     97        hmq = WinCreateMsgQueue( hab, 0 );
     98
     99        if ( modName[0] == 0 ) { // No modulename
     100            snprintf( msg, sizeof( msg ), "Error loading Lucide.dll: SYS%04u", rc );
     101        }
     102        else {
     103            snprintf( msg, sizeof( msg ),
     104                      "Error loading Lucide.dll: can't find module '%s' (SYS%04u)",
     105                      modName, rc );
     106        }
     107        WinMessageBox( HWND_DESKTOP, NULLHANDLE, msg, NULL, 1, MB_OK | MB_MOVEABLE );
     108
     109        WinDestroyMsgQueue( hmq );
     110        WinTerminate( hab );
    84111    }
    85112
Note: See TracChangeset for help on using the changeset viewer.