Summary of the invention
Based on this, be necessary to provide a kind of and can derive the method for the exporting prototype of dynamic prototype.
In addition, also be necessary to provide a kind of device that can derive the exporting prototype of dynamic prototype.
The method of said exporting prototype comprises: read resource file, generate the demonstration program file; With demonstration program file and dynamic link library file packing, generate the prototype file;
Defined built-in function in the said dynamic link library file, demonstration program utilizes said built-in function to show and reads the data in the said resource file; Said demonstration program file reads dynamic link library file and resource file through demonstration program when operation, accomplish the demo function of prototype file;
The step of said generation prototype file is specially:
Newly-built empty file stream;
Read the document flow of prototype file, demonstration program file and dynamic link library file;
The document flow of said prototype file, demonstration program file and dynamic link library file is write in the said empty file stream;
Obtain the length value of said demonstration program file and dynamic link library file, and the length value of said demonstration program file and dynamic link library file is written in the said empty file stream.
Said prototype file can be an executable file.
Wherein, the step of generation demonstration program file specifically can be: newly-built empty file stream; Read the document flow of demonstration program file and resource file; The document flow of demonstration program file and resource file is write in the empty file stream.
And the step that generates the demonstration program file also can comprise: obtain the length value of demonstration program file, and the length value of demonstration program file is written in the empty file stream.
In addition, this method also can comprise: read the prototype file, obtain the document flow of prototype file; From document flow, read the length value of demonstration program file and dynamic link library file; Read the document flow of demonstration program file according to the length value of demonstration program file, generate the demonstration program file; Read the document flow of dynamic link library file according to the length value of dynamic link library file, generate dynamic link library file.
This method also can comprise: read the demonstration program file, obtain the document flow of demonstration program file; From said document flow, read the length value of demonstration program; Read the document flow of resource file according to the length value of demonstration program file, generate resource file; Utilize the built-in function demonstration in the dynamic link library file or read interface and the response message in the resource file.
The device of said exporting prototype comprises: the shell load-on module is used for demonstration program file and dynamic link library file packing are generated the prototype file; Defined built-in function in the said dynamic link library file, demonstration program utilizes said built-in function to show and reads the data in the said resource file; Said demonstration program file reads dynamic link library file and resource file through demonstration program when operation, accomplish the demo function of prototype file; Demonstration module links to each other with the shell load-on module, reads resource file, generates the demonstration program file; Dynamic link library links to each other with shell load-on module and demonstration module, preserves built-in function; Resource module links to each other with demonstration module, preserves resource file; Said shell load-on module also is used for through newly-built empty file stream; Read the document flow of prototype file, demonstration program file and dynamic link library file; And the document flow of said prototype file, demonstration program file and dynamic link library file is written in the empty file stream, thereby generate the prototype file; Said shell load-on module also is used to obtain the length value of said demonstration program file and dynamic link library file, and said length value also is written in the empty file stream.
Said prototype file can be an executable file.
In the method for above-mentioned exporting prototype and the device, generate the demonstration program file, and, generate the prototype file demonstration program file and dynamic link library file packing through reading resource file.The prototype file that is generated is an independently executable file, does not have any subsidiary configuration file, and under the environment that breaks away from the prototype instrument, also can move.Then can be during operation prototype file through the built-in function in the dynamic link library file, read and show interface and the response message in the resource file.Therefore, derivation be dynamic prototype, it has outside the user interface of high-fidelity, also can carry out response events.
Embodiment
Fig. 1 shows the method flow of exporting prototype among the embodiment, and detailed process is following:
In step S101, read resource file, generate the demonstration program file.
In step S102,, generate the prototype file with demonstration program file and dynamic link library file packing.
In the above-mentioned resource file, contain user interface and response data etc., it can have the .res file extension.And dynamic link library file (being also referred to as dll file) is a kind of configuration file, has wherein defined a large amount of built-in functions, and demonstration program can utilize these built-in functions to show and read the data in the resource file.The demonstration program file that generates can read dynamic link library file and resource file through demonstration program when operation, accomplish the demo function of prototype file.
Fig. 2 shows the method flow that generates the demonstration program file among the embodiment, and detailed process is following:
In step S201, newly-built empty file stream.
In step S202, read the document flow of demonstration program file, obtain the length value of demonstration program file.
In step S203, read the document flow of resource file.Contain user interface and response data etc. in the resource file.
In step S204, with the document flow of demonstration program file and resource file, and the length value of demonstration program file writes in the empty file stream.At this moment, the file of generation is the demonstration program file.
Fig. 3 shows the method flow that generates the prototype file among the embodiment, and detailed process is following:
In step S301, newly-built empty file stream.
In step S302, read the document flow of prototype file.
In step S303, read the document flow of demonstration program file, and obtain the length value of demonstration program file.
In step S304, read the document flow of dynamic link library file, and obtain the length value of dynamic link library file.
In step S305, the document flow of prototype file, demonstration program file and dynamic link library file is write in the empty file stream.
In step S306, the length value of demonstration program file and dynamic link library file is write in the empty file stream.At this moment, the file of generation is the prototype file.
The prototype file of above-mentioned generation is an independently executable file (.exe file), need not subsidiary any configuration file, and can under the environment that breaks away from the prototype instrument, move, and will set forth the detailed process of operation prototype file below.
Fig. 4 shows the method flow of operation prototype file among the embodiment, and detailed process is following:
In step S401, read the prototype file, obtain the document flow of prototype file;
In step S402, from said document flow, read the length value of demonstration program file and dynamic link libraries file;
In step S403, read the document flow of demonstration program file according to the length value of demonstration program file, generate the demonstration program file.This demonstration program file is a file independently, can be kept in the local folders.
In step S404, read the document flow of dynamic link library file according to the length value of dynamic link library file, generate dynamic link library file.This dynamic link library file is a file independently, can be kept in the local folders.
Fig. 5 shows the method flow of operation demonstration program file among the embodiment, and detailed process is following:
In step S501, read the demonstration program file, obtain the document flow of demonstration program file.
In step S502, from said document flow, read the length value of demonstration program file.
In step S503, read the document flow of resource file according to the length value of demonstration program file, generate resource file.
In step S504, utilize the built-in function demonstration in the dynamic link library file or read interface and the response message in the resource file.
Can know by foregoing; During operation prototype file; Can read the data in dynamic link library file and the resource file through demonstration program, show or read interface and the response message in the resource file, accomplish the demo function of prototype file through the built-in function in the dynamic link library file.The prototype file of therefore being derived is dynamic, and it provides respective interface, and can carry out response events (as clicking or double-click response etc.), makes the prototype of derivation more lively, has satisfied user's demand for experience.
Fig. 6 shows the device of exporting prototype among the embodiment, and this device comprises shell load-on module 100, demonstration module 200, dynamic link library 300 and resource module 400, wherein:
Shell load-on module 100 is used for demonstration program file and dynamic link library file packing are generated the prototype file; Demonstration module 200 links to each other with the shell load-on module, is used to read resource file, generates the demonstration program file; Dynamic link library 300 links to each other with shell load-on module 100 and demonstration module 200, is used to preserve built-in function; Resource module 400 links to each other with demonstration module 200, is used to preserve resource file.
In one embodiment; Demonstration module 200 is through newly-built empty file stream; Read the document flow of the resource file in demonstration program file and the resource module 400, and the document flow of demonstration program file and resource file is write in the empty file stream, thereby generate the demonstration program file.In one embodiment, demonstration module 200 also can obtain the length value of demonstration program file, and this length value also is written in the empty file stream.And shell load-on module 100 is through newly-built empty file stream; Read the document flow of prototype file, demonstration program file and dynamic link library file; And the document flow of this prototype file, demonstration program file and dynamic link library file is written in the empty file stream, thereby generate the prototype file.In one embodiment, shell load-on module 100 also can obtain the length value of demonstration program file and dynamic link library file, and this length value also is written in the empty file stream.
In one embodiment; By shell load-on module 100 operation prototype files; Obtain the document flow of prototype file through the prototype file that reads above-mentioned generation; And from document flow, read the length value of demonstration program file and dynamic link library file, read the document flow of demonstration program file according to the length value of demonstration program file, thereby generate independently demonstration program file; Read the document flow of dynamic link library file according to the length value of dynamic link library file, thereby generate independent dynamic chained library file.Demonstration program file that is generated and dynamic link library file can be kept in the local folders, have defined built-in function in the dynamic link library file, can offer demonstration module 200.
In one embodiment; By demonstration module 200 operation demonstration program files; Obtain the document flow of demonstration program file through the demonstration program file that reads above-mentioned generation; And read the length value of demonstration program file from document flow, read the document flow of demonstration program file according to this length value, thereby generate independently demonstration program file.In addition, preserve resource file in the resource module 400, can offer demonstration module 200.Demonstration module 200 reads the document flow of resource file according to the length value of demonstration program file, thereby generates independently resource file.The demonstration program file and the resource file that are generated can be kept in the local folders.During these demonstration program files of demonstration module 200 operation, utilize the built-in function in the dynamic link library file, show or read interface information and the response message in the resource file.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.