Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines From: mouse@lightning.mcrcim.mcgill.EDU Newsgroups: comp.windows.x Subject: Re: Help on XrmGetResource Message-ID: <9102210941.AA11117@lightning.McRCIM.McGill.EDU> Date: 21 Feb 91 09:41:55 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 51 > I am having a problem retrieving resources from the resource manager > database. I am able to load a file into the database using > XrmGetFileDatabase, but I cannot retrieve the information from the > database. I am getting a segmentation fault upon using the > XrmGetResource function. I can't really guess why this might be without seeing the code. > If anyone has successfully used these Xrm functions please send me > email. An example of code would also be greatly appreciated. My code does things like this. (This is highly condensed; lots of irrelevant code has been stripped out.) char *defaults = "..."; /* hardwired default defaults */ XrmDatabase db; .... char *str; XrmDatabase db2; db = XrmGetStringDatabase(defaults); str = XResourceManagerString(disp); if (str) { db2 = XrmGetStringDatabase(str); XrmMergeDatabases(db2,&db); } else { /* ...construct a filename based on $HOME... */ db2 = XrmGetFileDatabase(str); if (db2) { XrmMergeDatabases(db2,&db); } } .... char *name; char *class; char *type; XrmValue value; if (XrmGetResource(db,name,class,&type,&value) == False) { /* ...failure... */ } else { /* value.addr points to the thing found in the database */ } If you're still having trouble, I'd be willing to look at a small test program.... der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu