Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

resource file management problem

Status
Not open for further replies.

scienzia

Programmer
Joined
Feb 21, 2002
Messages
160
Location
IT
Hi

I would like to know how to put a file in the resources and read it in my application.

It is a binary file.
I found something about usual kinds of resources (icons, bitmaps, wav ...) but nothing to handle a binary file

Thanks in advance
 
Open up your project's RC2 file (usually projname/res/projname.rc2) in a text editor. Add a line

[tt]IDR_identifier DATA "filename"[/tt]

I think that's right. Note that filename is relative to the project root directory, not the res subdirectory.

You can obtain a handle to the resource with the FindResource API. You can load the resource with the LoadResource API. Then use the LockResource API to obtain a pointer to the memory where the resource is loaded.

I REALLY hope that helps.
Will
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top