bool MsgGet( int resourceid, char *buffer ) /*****************************************/ { #ifdef BOOTSTRAP struct idstr *s; struct idstr msgid; msgid.id = resourceid; s = bsearch( &msgid, StringTable, _arraysize( StringTable ), sizeof( *s ), compar ); if( s == NULL ) { buffer[0] = NULLCHAR; return( false ); } strcpy( buffer, s->s ); #else if( hInstance.status == 0 || WResLoadString( &hInstance, resourceid + MsgShift, (lpstr)buffer, MAX_RESOURCE_SIZE ) <= 0 ) { buffer[0] = NULLCHAR; return( false ); } #endif return( true ); }
int MsgGet( int resourceid, char *buffer ) /***********************************************/ { #ifdef BOOTSTRAP { struct idstr *s; struct idstr msgid; msgid.id = resourceid; s = bsearch( &msgid, StringTable, _arraysize( StringTable ), sizeof( *s ), compar ); if( s == NULL ) { buffer[0] = '\0'; return( 0 ); } strcpy( buffer, s->s ); } #else if( LoadString( &hInstance, resourceid + MsgShift, (LPSTR)buffer, MAX_RESOURCE_SIZE ) == -1 ) { buffer[0] = '\0'; return( 0 ); } #endif return( 1 ); }