将数据文件集成到程序中 - 阿蒙编程之家(Integrating data files into programs - the home of Amon programming).doc
文本预览下载声明
将数据文件集成到程序中 - 阿蒙编程之家(Integrating data files into programs - the home of Amon programming)
The data file is integrated into the program programming amon home.Txt is a mountain fox, you told me what all, standing in the place nearest to you, look you smile to others, even if the heart is all the pain just to put your every act and every move a panoramic view. Dazzling white, let me understand what is pure damage. VC++ 5 programming experience
First, the external data files that are invoked by the application are integrated into the program executable file
We know that the Windows application includes two parts, the execution code and the program resource. For example, the bits of the application
Diagrams, icons, dialog boxes, string tables, etc. are stored in application resources. For a number of external applications
Small data files, on the one hand easy to lose, which will result in program errors, on the other hand, there is security and confidentiality is not strong
Other disadvantages. Therefore, you can consider integrating them into a program executable file, which can speed up data reading.
There are two key steps in implementing this functionality: first, put these files as program resources into the resource file; then
Later, when the program execution data file is loaded, the files are read from the resource memory.
1. Add data files to the resource file
(1) first, open a resource file with a text editor (Notepad, tablet, etc.), that is, a file with the RC extension
(Note: this can only be opened with a text editor, because the acceleration is not supported in the Visual C++5.0 resource editor
Key tables, bitmaps, dialog boxes, cursors, icons, menus, toolbars, strings, tables, versions, information, and other non-standard resources other than standard
Insertion of quasi resources. To be on the safe side, first backup the resource file when doing the following, and then add the following lines of code:
//////////////////////////////////////////////////////
显示全部