bool GUILoadStrInit( const char * fname ) { #ifndef __OS2_PM__ WPI_INST library; #endif char * ext_name; fname = fname; if( !GUIMsgInitFlag ) { ext_name = GUIGetExtName(); external = ( ext_name != NULL ); #ifndef __OS2_PM__ if( external ) { // if an external resource DLL is specified, then load it library = _wpi_loadlibrary( GUIMainHInst, ext_name ); if( library != NULL ) { memcpy( &GUIResHInst, &library, sizeof( WPI_INST ) ) ; } else { return( FALSE ); } } #endif GUIMsgInitFlag = TRUE; return( TRUE ); } else { return( FALSE ); } }
bool GUILoadStrInit( const char *fname ) { bool error; error = OpenResFile( &hInstance, fname ) == NIL_HANDLE; if( !error ) { if( GUIGetExtName() != NULL ) { // we are using an external resource file so we don't have to // search FileShift = 0; } else { error = FindResources( &hInstance ); } } if( !error ) { error = InitResources( &hInstance ); } if( error ) { GUIMsgInitFlag = FALSE; write( fileno(stdout), NO_RES_MESSAGE_PREFIX, sizeof( NO_RES_MESSAGE_PREFIX ) - 1 ); write( fileno(stdout), fname, strlen( fname ) ); write( fileno(stdout), NO_RES_MESSAGE_SUFFIX, sizeof( NO_RES_MESSAGE_SUFFIX ) - 1 ); } else { GUIMsgInitFlag = TRUE; } return( GUIMsgInitFlag ); }
bool GUILoadStrInit( const char *fname ) { hInstance.status = 0; if( OpenResFileX( &hInstance, fname, GUIGetExtName() != NULL ) ) { // if we are using an external resource file then we don't have to search return( true ); } CloseResFile( &hInstance ); posix_write( fileno( stdout ), NO_RES_MESSAGE_PREFIX, sizeof( NO_RES_MESSAGE_PREFIX ) - 1 ); posix_write( fileno( stdout ), fname, strlen( fname ) ); posix_write( fileno( stdout ), NO_RES_MESSAGE_SUFFIX, sizeof( NO_RES_MESSAGE_SUFFIX ) - 1 ); return( false ); }
bool GUILoadStrInit( const char *fname ) { hInstance.handle = NIL_HANDLE; if( !OpenResFile( &hInstance, fname ) ) { // if we are using an external resource file then we don't have to search FileShift = 0; if( GUIGetExtName() != NULL || !FindResources( &hInstance ) ) { if( !InitResources( &hInstance ) ) { GUIMsgInitFlag = true; return( true ); } } CloseResFile( &hInstance ); } write( fileno(stdout), NO_RES_MESSAGE_PREFIX, sizeof( NO_RES_MESSAGE_PREFIX ) - 1 ); write( fileno(stdout), fname, strlen( fname ) ); write( fileno(stdout), NO_RES_MESSAGE_SUFFIX, sizeof( NO_RES_MESSAGE_SUFFIX ) - 1 ); GUIMsgInitFlag = false; return( false ); }