|
-
February 27th, 2004, 07:37 PM
#1
Resources For Release Version
I have a bunch of bitmaps/icons I use in the release version of a program. I was hoping to incorporate them in the executable file so I don't have to add a list image files along with the executable.
Many of them are loaded using LoadImage. Can I do it so they are lumped into the executable?
Thanks,
Matt
-
February 27th, 2004, 07:42 PM
#2
Re: Resources For Release Version
Originally posted by hatflyer
Many of them are loaded using LoadImage. Can I do it so they are lumped into the executable?
Just add them as bitmap and icon resources. As for LoadImage(), when you omit the LR_LOADFROMFILE flag, the lpszName will be treated as the resource identifier instead of the filename (actually, that's the default behaviour of LoadImage).
-
February 27th, 2004, 11:58 PM
#3
I'm still confused. I did add them as resources, and here is the code I had been using for one of the icons:
HICON hIcon = (HICON) ::LoadImage(NULL,"res\\ok.ico",IMAGE_ICON,50,24,LR_LOADFROMFILE);
Was format should I use so that I don't have to physically include the ok.icon resource when I give a copy of my executable to someone else?
Thanks
-
February 28th, 2004, 06:23 AM
#4
Are you sure you know what a resource is? The code you posted still reads from a file, as it still uses the LR_LOADFROMFILE flag and a file name as the second parameter. To include your icons and bitmaps as resources in your executable, add them to your project's resources using the resource editor. Then you will be able to load them via LoadImage() by specifying the resource identifier (instead of the file name).
-
February 28th, 2004, 12:34 PM
#5
ALl the icons and bitmaps were created in the resource editor of the project. They all have an ID (the one I mentioned loaded from a file has the ID of IDI_RESET).
The parameters for the function LoadImage are confusing. If I don't use the LoadFromFile flag, which do I use? And what is the format of the icon/bitmap identifier? A handle? Is NULL used as the first parameter?
As you can tell, I'm a newbie.
-
February 28th, 2004, 10:41 PM
#6
LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RESET),...,...,...,...);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|