home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!lsl!snail
- From: snail@lsl.co.uk
- Newsgroups: comp.windows.x
- Subject: XGetErrorDatabaseText
- Message-ID: <1992Jul24.172236.2178@lsl.co.uk>
- Date: 24 Jul 92 16:22:36 GMT
- Organization: Laser-Scan Ltd., Cambridge
- Lines: 57
-
- OK I'm thoroughly miffed here, I shouldn't need to post this, but quite frankly
- I can't get what I want and there aren't any demo bits of cod ein any of my
- books, just the definition of the function.
-
- So just how do you use XGetErrorDatabaseText() ?
-
- XGetErrorDatabaseText(Display,
- app_name, /* is this argv[0] or the -name argument? */
- XXXXX_STRING, /* see below */
- "my defualt message if it fails - it will!",
- my_default_buffer_for_message,
- my_default_buffer_length);
-
- error request code I'm trying to get is
-
- XError *error_event;
- error_event->request_code; /* This is what I'm saying is 8 for the example */
-
- (I know about XGetErrorText() and I use it for error_event->error_code.)
-
- OK so assuming my error request code is say error 8 (X_MapWindow) this is in
- the /usr/lib/X11/XErrorDB file as
-
- XRequest.8:X_MapWindow
-
- Obviosly I'll be taking the real error number from an XError, but for this
- exmaple, we'll use an error number (Major Opcode) of 8.
- But why if I call the function do I always get my default text, no
- matter what I pass for XXXXX_STRING. I've tried:-
-
- 1) casting the error code to a char and passing it's address as XXXXX_STRING.
- 2) using sprintf to create a) "8"
- b) "XRequest.8"
- c) "XRequest.8:"
- d) "XRequest8"
- e) "XRequest8:"
- and then pass that string as XXXXX_STRING.
-
- Why doesn't it work, irrespective of platform (DEC, Sun, HP, IBM etc)
-
- WARNING: I only want an example, don't quote the standard RTFM or bits of it
- at me, doing that will get you a flame. I'm at my wits end. I want a
- concrete example that works. Sure after reading this warning you may not
- feel inclined to respond, but I'd rather that than people just spouting the
- manual at me. BY concrete - I mean some code, not a description!
-
- Oh yeah, I've also tried XProtoError (I Suspect this is correct) and
- XLibMessage and XRequestMajor, all with similar extensions (.8, .8: etc) as
- above, all with no luck.
-
- For an example assume protocol request value of 8 and XProtoError. See if you
- can give me some code that works.
-
- Hoping some kind soul will help
-
- Stephen Kellett
- snail@lsl.co.uk
-