The information in this article applies to:
SUMMARYRESFILE.EXE is a sample project that shows how to store any file type in a resource file and retrieve the file for use at run-time. MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center. Click the file names below to download the files: Resfile.exeRelease Date: Oct-19-1998 For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. Programmers often want to use files with their application, but do not want to install these files into the application directory for fear that the user might delete or modify them. Examples of this include an RTF or Word file for a "Readme" file, GIF and JPG files for images, or MIDI files for sound and data files. One of the ways to distribute these required files is to include them in a resource file. The resource file is compiled into the EXE. This makes the included files available to the program, but keeps the user from being able to modify them. A resource file can contain any type of data. It can load certain types of data directly, such as bitmaps, icons, and strings using LoadResPicture and LoadResString. Other types of data must be stored in the resource file as a "custom" resource. Custom resources must be retrieved from the resource file using the LoadResData function intrinsic to Visual Basic. Although the Visual Basic Help file says "The data that LoadResData loads from the resource file can be up to 64K," this is a limitation for the 16- bit versions of Visual Basic. The 32-bit versions of Visual Basic have no problem reading larger amounts of data. To use the custom resource, you can simply use the LoadResData function to retrieve the resource into a byte array, then save the byte array to a temporary file, use the file, and then delete the temporary file. The Resfile.exe sample has a reusable module for handling these resource file operations. This module has two functions to make the resource file tasks easier.
Additional query words: kbDSupport kbVBp600 kbAddIn kbSample kbResourceEd kbdss kbVBp
Keywords : kbfile kbGrpVB |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |