Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Single node that will obsolete the Windows Error Lookup Guide

created by tftv256

(thing) by everyone (3.1 mon) (print)   ?   (I like it!) 1 C! Mon Dec 11 2000 at 20:29:23

Foolish Windows users... Those 14-hundred some nodes are quite a waste of space.

The following interactive program I wrote will lookup a Win32 error. You can specify a hexadecimal error code by prepending 0x, or a decimal by simply entering the number. It will compile on Borland C++ 5.0 as a Win32 console application (wharfinger tells me it also works with VC++ 6).

novalis: then let's post a binary. :-) http://members.tripod.com/andy_779/err.exe

#include <windows.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>

#define KEY_BS          8
#define KEY_ENTER       '\r'

int main() {

        char *buf = NULL, flag = 0, hex = 0;
        size_t len = 0;
        int c;

        cprintf( "Enter error code: " );
        while( (c=getch()) != KEY_ENTER ) {
                if( c == 0 )
                        continue;
                putch( c );
                if( c == KEY_BS ) {
                        if( len != 0 )
				len--;
                        continue;
                }
                len++;
                buf = (char *) realloc( buf, len );
                assert( buf != NULL );
                buf[len-1] = c;
        }
        buf = (char *) realloc( buf, len+1 );
        assert( buf != NULL );
        buf[len] = 0;
        cprintf( "\r\n" );
        if( strncmp( buf, "0x", 2 ) == 0 ) {
                hex = 1;
                buf += 2;
	}
        for( c=0; c<strlen(buf); c++ )
                if( (buf[c] < '0' || buf[c] > '9') && !hex ) {
                        cprintf( "\"Number\" contains "
				 "invalid characters.\r\n" );
                        flag = 1;
                        c = len;
                }

        if( !flag ) {
                DWORD error;
                char *nbuf;
                if( hex )
                        sscanf( buf, "%x", &error );
                else
                        sscanf( buf, "%d", &error );
                FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM |
				FORMAT_MESSAGE_ALLOCATE_BUFFER,
				&error, error, 0, &nbuf, 0, NULL );
                cprintf( "Error code %d: %s", error, nbuf );
                LocalFree( nbuf );
        }

        if( hex )
                buf -= 2;
        free( buf );

        cputs( "Press any key to continue." );
        while( !kbhit() );
        return 0;

}

printable version
chaos

Windows Error Lookup Guide How to Get a Copy of Your FBI File windows jokes Evaluating the usefulness of the Windows Error Lookup Guide
You noders still fucking suck, but your needing my wisdoms bad Windows Error 0x00000470 - 0x0000052F All-in-One crap, iMacs pt deux E2
Making a railgun Rage Against The Machine Windows 1.0 The "My parents suck with computers" node
If the problem persists, contact the program vendor Proxima Shared Universe Too many secrets Seinfeld
Microsoft Windows Linux Jakob Nielsen Windows 3.1
Dream Log: December 10, 2000 Dealing with widowhood, children and dating Watchmen There's nothing noble about being a soldier
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
What you are reading:
Justice
Doreen
Dearest, I feel certain
A Sniper in Every Minaret
Gallipoli
stem cell
like this
Glamis Castle
Thermopylae
Vaguely valid advice to prospective weight trainers
This freaking obsession with really abysmal porn
Oxford Movement
Nagasaki
New Writeups
The Jacket
Words of Advice(idea)
keepinitreal
Why buy the cow when you can get the milk for free?(idea)
John_Fox
Good Intentions Gone Wrong(person)
Cuckowski
Slavonic Princess(poetry)
Heitah
Posthumous Oscar(thing)
ignis_glaciesque
University of South Florida(place)
ignis_glaciesque
Flogstaskriket(idea)
liveforever
Caesar's last breath(idea)
dagnyswaggart
she wants to believe(personal)
antigravpussy
he doesn't know, but her eyes widen too far(thing)
dagnyswaggart
Wild tides guard her secrets(poetry)
Lord Brawl
Caesar's last breath(poetry)
locke baron
Forgotten things in space(fiction)
sitaraika
Colours(idea)
etouffee
Wild tides guard her secrets(poetry)
This affordable entertainment brought to you by The Everything Development Company