Пример #1
0
bool InitRcMsgs( void )
{
    bool        error;
    char        testbuf[1];
#if defined( IDE_PGM ) || !defined( __WATCOMC__ )
    char        imageName[_MAX_PATH];
#else
    char        *imageName;
#endif

#if defined( IDE_PGM )
    _cmdname( imageName );
#elif !defined( __WATCOMC__ )
    get_dllname( imageName, sizeof( imageName ) );
#else
    imageName = _LpDllName;
#endif
    /*
     * swap open functions so this file handle is not buffered.
     * This makes it easier for layer0 to fool WRES into thinking
     * that the resource information starts at offset 0
     */
    error = RCOpenResFile( &Instance, imageName );
    MsgShift = _WResLanguage() * MSG_LANG_SPACING;
    if( !error && !GetRcMsg( USAGE_MSG_FIRST, testbuf, sizeof( testbuf ) ) ) {
        error = true;
    }
    if( error ) {
        RcFatalError( ERR_RCSTR_NOT_FOUND );
    }
    return( true );
}
Пример #2
0
int InitMsg( void )
{
    char        buff[_MAX_PATH];
#if defined( IDE_PGM ) || !defined( __WATCOMC__ )
    char        imageName[_MAX_PATH];
#else
    char        *imageName;
#endif

    hInstance.handle = NIL_HANDLE;
#if defined( IDE_PGM )
    _cmdname( imageName );
#elif !defined( __WATCOMC__ )
    get_dllname( imageName, sizeof( imageName ) );
#else
    imageName = _LpDllName;;
#endif
    BannerPrinted = false;
    if( !OpenResFile( &hInstance, imageName ) ) {
        if( !FindResources( &hInstance ) && !InitResources( &hInstance ) ) {
            MsgShift = _WResLanguage() * MSG_LANG_SPACING;
            if( Msg_Get( MSG_PRODUCT, buff ) ) {
                Res_Flag = EXIT_SUCCESS;
                return( Res_Flag );
            }
        }
        CloseResFile( &hInstance );
        hInstance.handle = NIL_HANDLE;
    }
    WriteStdOutInfo( NO_RES_MESSAGE, ERR, NULL );
    Res_Flag = EXIT_FAILURE;
    return( Res_Flag );
}
Пример #3
0
bool InitMsg( void )
{
    char        msg_buff[RESOURCE_MAX_SIZE];
#if defined( IDE_PGM ) || !defined( __WATCOMC__ )
    char        imageName[_MAX_PATH];
#else
    char        *imageName;
#endif

#if defined( IDE_PGM )
    _cmdname( imageName );
#elif !defined( __WATCOMC__ )
    get_dllname( imageName, sizeof( imageName ) );
#else
    imageName = _LpDllName;;
#endif
    BannerPrinted = false;
    hInstance.status = 0;
    if( OpenResFile( &hInstance, imageName ) ) {
        MsgShift = _WResLanguage() * MSG_LANG_SPACING;
        if( Msg_Get( MSG_GENERAL_HELP_0, msg_buff ) ) {
            return( true );
        }
    }
    CloseResFile( &hInstance );
    WriteStdOutInfo( NO_RES_MESSAGE, ERR, NULL );
    return( false );
}
Пример #4
0
int InitRcMsgs( void )
{
    int         error;
    WResFileID  (* oldopen)(const char *, int, ...);
    char        testbuf[1];
#if defined( IDE_PGM ) || !defined( __WATCOMC__ )
    char        imageName[_MAX_PATH];
#else
    char        *imageName;
#endif

#if defined( IDE_PGM )
    _cmdname( imageName );
#elif !defined( __WATCOMC__ )
    get_dllname( imageName, sizeof( imageName ) );
#else
    imageName = _LpDllName;
#endif
    /*
     * swap open functions so this file handle is not buffered.
     * This makes it easier for layer0 to fool WRES into thinking
     * that the resource information starts at offset 0
     */
    oldopen = WResRtns.open;
    WResRtns.open = open;
    error = OpenResFile( &Instance, imageName );
    WResRtns.open = oldopen;
    if( !error ) {
        RegisterOpenFile( Instance.handle );
        error = FindResources( &Instance );
        if( !error ) {
            error = InitResources( &Instance );
        }
        if( error ) {
            CloseResFile( &Instance );
            UnRegisterOpenFile( Instance.handle );
        }
    }
    MsgShift = _WResLanguage() * MSG_LANG_SPACING;
    if( !error && !GetRcMsg( USAGE_MSG_FIRST, testbuf, sizeof( testbuf ) ) ) {
        error = TRUE;
    }
    if( error ) {
        RcFatalError( ERR_RCSTR_NOT_FOUND );
    }
    return( 1 );
}