[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1132.0. "Who had the error ??" by HPSTEK::JBATES (John D. Bates) Tue Jul 18 1989 17:03

	I have written an error handler and would like to know how to
	translate the request_code field in the XErrorEvent structure to 
	a facility code. (I.E. if the request_code is a 2A then how do I
	translate that to XSetInputFocus)

					John

T.RTitleUserPersonal
Name
DateLines
1132.1Hi boys and girls...GSRC::WESTI'm just visiting this planet.Tue Jul 18 1989 21:328
  Can you say, "Look up table" ??  :^)

  I haven't found a way either...

					-=> Jim <=-


1132.2GOSOX::RYANDECwindows MailWed Jul 19 1989 08:136
	Look in DECW$INCLUDE:XPROTO.H -

#define X_SetInputFocus                42

	Mike

1132.3FLUME::dikeWed Jul 19 1989 08:363
What's the matter with XGetErrorText and XGetErrorDatabaseText?
			Jeff

1132.4HPSTEK::JBATESJohn D. BatesWed Jul 19 1989 12:0910
	Re: .3

	I have used XGetErrorText and XGetErrorDatabaseText before but I
	don't know how to use them to perform the translation to the 
	facility text.
	
	Any clues or examples?

					John

1132.5here's an example of how the Xlib default error handler does it.DECWIN::JACKIEJackie FergusonFri Jul 21 1989 08:3139
int _XPrintDefaultError (dpy, event, fp)
    Display *dpy;
    XErrorEvent *event;
    FILE *fp;
{
    char buffer[BUFSIZ];
    char mesg[BUFSIZ];
    char number[32];
    char *mtype = "XlibMessage";
    XGetErrorText(dpy, event->error_code, buffer, BUFSIZ);
    XGetErrorDatabaseText(dpy, mtype, "XError", "X Error", mesg, BUFSIZ);
    (void) fprintf(fp, "%s:  %s\n  ", mesg, buffer);
    XGetErrorDatabaseText(dpy, mtype, "MajorCode", "Request Major code %d",
        mesg, BUFSIZ);
    (void) fprintf(fp, mesg, event->request_code);
    sprintf(number, "%d", event->request_code);
    XGetErrorDatabaseText(dpy, "XRequest", number, "",  buffer, BUFSIZ);
    (void) fprintf(fp, " (%s)", buffer);
    fputs("\n  ", fp);
    XGetErrorDatabaseText(dpy, mtype, "MinorCode", "Request Minor code",
        mesg, BUFSIZ);
    (void) fprintf(fp, mesg, event->minor_code);
    fputs("\n  ", fp);
    XGetErrorDatabaseText(dpy, mtype, "ResourceID", "ResourceID 0x%x",
        mesg, BUFSIZ);
    (void) fprintf(fp, mesg, event->resourceid);
    fputs("\n  ", fp);
    XGetErrorDatabaseText(dpy, mtype, "ErrorSerial", "Error Serial #%d",
        mesg, BUFSIZ);
    (void) fprintf(fp, mesg, event->serial);
    fputs("\n  ", fp);
    XGetErrorDatabaseText(dpy, mtype, "CurrentSerial", "Current Serial #%d",
        mesg, BUFSIZ);
    (void) fprintf(fp, mesg, dpy->request);
    fputs("\n", fp);
    if (event->error_code == BadImplementation) return 0;
    return 1;
}

1132.6re .5: What's the return value mean? It's not documented...GOSOX::RYANDECwindows MailMon Jul 24 1989 10:021
1132.7what return value?DECWIN::JACKIEJackie FergusonMon Jul 24 1989 12:157
Mike,
What return value do you mean?  The question was how to call XGetErrorText and
XGetErrorDatabaseText.  These don't have a return value.  If you mean the
default error handler, I think I answered that question the last time you asked.

Jackie

1132.8GOSOX::RYANDECwindows MailTue Jul 25 1989 09:155
	My mistake, I thought .5 was supposed to be the error handler itself,
	but I guess it's a routine called by the default error handler...

	Mike