Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sdrc!sphorton From: sphorton@sdrc.UUCP (Mitch_Horton) Newsgroups: comp.windows.x Subject: XrmGetResource Keywords: XrmGetResource Message-ID: <1532@sdrc.UUCP> Date: 14 Aug 90 14:25:54 GMT Organization: SDRC, Cincinnati Lines: 52 I am attempting to process user defaults as prescribed in Adrian Nye's Xlib Programming Manual Volume One. Here is the code segment that parses the command line into an XrmDatabase structure and attempts to retrieve the display from the structure: static XrmDatabase commandlineDB; XrmValue Value; char *str_typ[20]; static int opTableEntries = 25; static XrmOptionDescRec opTable[] = { . . . {"-display", "*display", XrmoptionSepArg, (caddr_t) "NULL"} . . . }; XrmParseCommand (&commandlineDB, opTable, opTableEntries, argv[0], argc, argv); if (XrmGetResource (commandlineDB, "m.display", "", str_type, &value) == True) { (void) strncpy (myDisplayName, value.addr, (int) value.size); } My application is called m. What I mean is that the executable looks lik I call it with -display dkdkdk as the command line arguments. In the debugger, I can see that argv and argc contain what I expect. XrmGetResource, however, always returns false no matter what I do. This must either be because XrmParseCommand is not loading the XrmDatabase properly or because XrmGetResource is not accessing the XrmDatabase properly. Since I do not have the Xrm routines source, I cannot follow this in the debugger. Also, I have had no success at reading the manual about Xrm and trying various things. Can anyone spot what is wrong with the above code fragment? Thanks, Mitch Horton