Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!kth!sunic!maxim!prc From: prc@erbe.se (Robert Claeson) Newsgroups: comp.windows.ms Subject: FindResource doesn't find resources Message-ID: <685@maxim.erbe.se> Date: 18 May 89 21:39:04 GMT Organization: Hall of Fame Lines: 38 I'm trying to use FindResource to find a string resource. Then I call SizeofResource to get the size of the resource. Using it, I do a LocalAlloc to allocate a buffer. Finally, I read the string into the buffer using LoadString. The point with all this is to dynamically allocate memory for strings, based on their length at run time rather than a good guess determined at compile time. This is especially nice in the application I'm writing, since there can be many different versions of the resource floating around and I don't want to update the source code when I'm just changing a few strings in the resource. The problem is, it doesn't work. FindResource doesn't find the resource I ask it to find, but LoadString loads the same strings quite nicely. According to my manual, FindResource accepts three arguments; the instance, an LPSTR to a string holding the name of the resource and an LPSTR to a string that holds the name of the resource type. The manual also mentions that if the high-order word of any of these two LPSTR arguments is zero, the low-order word is assumed to contain the integer ID of the resource or the integer ID of the resource type. I've tried to pass both integer and string ID's in all possible combinations and with all possible (I think) casts, but the damn function still doesn't find the resources for me. If there's anyone or anything out there who knows what's going on, *please* enlighten me. This problem has kept me awake the last nights. Thanks in advance, Robert -- Robert Claeson E-mail: rclaeson@erbe.se ERBE DATA AB