Announcement
Collapse
No announcement yet.
Get resource type using only the resource name?
Collapse
X
-
As an example, in many of Penzold's examples, he uses the program's name as the class name, the menu name, the icon name, ...
-
>that would give the type for a supplied resource name
Not possible: For any module you can have more than one resource with any given name, all of different types.
Leave a comment:
-
Thanks Michael and Edwin!
I saw the EnumResourceTypes on MSDN, but it would involve too much code for the simple task I'm trying to accomplish. I was hoping for a single API call or something that would give the type for a supplied resource name. I don't want to go to the trouble of enumerating all the available resources just to find the type of a single resource. It's easier just to pass the type as a variable to my subroutine.
Thanks!
Anthony
Leave a comment:
-
>Wasn't there an enumresources() ?
Nope.
But....
You can EnumResourceTypes(), then in your callback for that, do an EnumResourceNames() for that type... you'll end up with a list of all resources in the target module by name and type.
MCM
FWIW, this is legal
Code:FOO BITMAP filename FOO ICON filename FOO RCDATA filename FOO DIALOG
Last edited by Michael Mattias; 14 Apr 2009, 06:22 PM.
Leave a comment:
-
Get resource type using only the resource name?
Is there any way to determine what "type" an object in a resource file from just the resource name?
For example, my resource file has these two objects defined:
Code:PROGRAM ICON home.ICO TITLE BITMAP title.bmp
Thanks,
AnthonyTags: None
Leave a comment: