Ignore:
Timestamp:
Oct 9, 2006, 5:32:58 PM (15 years ago)
Author:
Eugene Romanenko
Message:

Better solution for #78, move GUI to DLL, executor sets BeginLibPath? and loads GUI DLL (closes #78)

File:
1 edited

Legend:

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

    r130 r138  
    4545
    4646char lucideDir[ CCHMAXPATH ] = "";
    47 char lucideExe[ CCHMAXPATH ] = "";
     47
     48typedef APIRET (APIENTRY *LMain)(int argc, char **argv);
    4849
    4950int main( int argc, char *argv[] )
    5051{
     52    int result = 1;
    5153    char *last_slash;
     54    HMODULE hmod = NULLHANDLE;
     55
     56#ifdef __TEST__
     57    PPIB pib;
     58    PTIB tib;
     59    DosGetInfoBlocks(&tib, &pib);
     60    pib->pib_ultype = 3;
     61#endif
    5262
    5363    // fill lucide dir
     
    5969        *last_slash = 0;
    6070    }
    61     // fill lucide exe
    62     strcpy( lucideExe, lucideDir );
    63     strcat( lucideExe, "\\Lucide.exe" );
    6471
    6572    // set beginlibpath
    6673    DosSetExtLIBPATH( lucideDir, BEGIN_LIBPATH );
    6774
    68     // execute lucide
    69     execvp( lucideExe, (char const **)argv );
     75    if ( DosLoadModule( NULL, 0, "Lucide", &hmod ) == 0 )
     76    {
     77        PFN pfn = NULL;
     78        if ( DosQueryProcAddr( hmod, 0, "LucideMain", &pfn ) == 0 )
     79        {
     80            LMain LucideMain = (LMain)pfn;
     81            result = LucideMain( argc, argv );
     82        }
     83        DosFreeModule (hmod);
     84    }
    7085
    71     return 0;
     86    return result;
    7287}
    7388
Note: See TracChangeset for help on using the changeset viewer.