Accessing Resources

Resources are contained inside EXEs and DLLs and thus occupy virtual address space that doesn't change during the life of the process. This fact makes it easy to read a resource directly. If you need to access a bitmap, for example, you can get the DIB address with code like this:

LPVOID lpvResource = (LPVOID) ::LoadResource(NULL,      ::FindResource(NULL, MAKEINTRESOURCE(IDB_REDBLOCKS),      RT_BITMAP)); 

The LoadResource function returns an HGLOBAL value, but you can safely cast it to a pointer.



Programming Visual C++
Advanced 3ds max 5 Modeling & Animating
ISBN: 1572318570
EAN: 2147483647
Year: 1997
Pages: 331
Authors: Boris Kulagin

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net