Summary of the invention
The technical matters that the present invention will solve is, holds the lower defective of software interface implementation efficiency to the existing customer, and a kind of system and method for client software operation is provided.
The technical solution adopted for the present invention to solve the technical problems is: constructs a kind of system of client software operation, comprises the contact bed module and the functional layer module of human window application program, and the middle layer module of Active X assembly formation:
The Html code that the contact bed module operation of said window application embeds window application generates the client software interface; And catch the trigger event on this client software interface, and the message of the trigger event that obtains is transmitted to the functional layer module of window application through Active X assembly through the JavaScript code that embeds window application;
The functional layer module of said window application is carried out the Message Processing code of window application according to the message of trigger event; Obtain feedback result, and the message of feedback result is transmitted to said window application through Active X assembly contact bed module is shown through said client software interface.
In the system according to client software operation of the present invention, the ActiveX assembly of said middle layer module has the intermediate layer message processing unit, and has the message pool of using Memory Mapping File and its; Said intermediate layer message processing unit is managed said Memory Mapping File and its, makes said contact bed module and functional layer module read or write the content of Memory Mapping File and its.
In the system according to client software operation of the present invention, said contact bed module further comprises:
The Html unit is used to move the Html code that embeds window application and generates the client software interface, and the message of reception feedback result shows through said client software interface;
The JavaScript unit is used for catching the trigger event on the said client software interface through the JavaScript code that embeds window application; And
The contact bed message processing unit; Link to each other with the intermediate layer message processing unit of said Html unit, JavaScript unit and middle layer module; The forwards of the trigger event that is used for said JavaScript unit is obtained is given said intermediate layer message processing unit, and the message of the feedback result that will obtain from said intermediate layer message processing unit sends to said Html unit and shows.
In the system according to client software operation of the present invention, said functional layer module further comprises:
The message performance element is used for the Message Processing code according to the message execution window application of trigger event, obtains feedback result;
The functional layer message processing unit; The message of the trigger event that is used for obtaining from the intermediate layer message processing unit of middle layer module sends to said message performance element, and the message of the feedback result that will obtain from said message performance element sends to said intermediate layer message processing unit.
In the system according to client software operation of the present invention, the ActiveX component internal of said middle layer module establishes the asynchronous message transmission interface; The trigger event that said contact bed module and functional layer module are sent and the message of feedback result are used for writing said Memory Mapping File and its through said asynchronous message transmission interface.
In the system according to client software operation of the present invention, and the ActiveX component internal of said middle layer module establishes message pool monitoring processing unit and self-defined message mapping macro interface; Said message pool monitoring processing unit is used for the monitoring message pond, judges whether to detect effective message; Said intermediate layer message processing unit shines upon macro interface when message pool monitoring processing unit monitors efficient message through said self-defined message, corresponding contact bed module or the functional layer module of being transmitted to.
The present invention also provides a kind of method of client software operation, may further comprise the steps:
The html code that the contact bed module operation of S1, window application embeds window application generates the client software interface, and catches the trigger event on this client software interface through the JavaScript code that embeds window application;
S2, said contact bed module are transmitted to the message of the trigger event that obtains the functional layer module of window application through Active X assembly;
The functional layer module of S3, said window application obtains feedback result according to the Message Processing code of the message execution window application of trigger event;
S4, said functional layer module show the message of feedback result is transmitted to said window application through Active X assembly contact bed module through said client software interface.
In the method according to client software operation of the present invention, said Active X assembly constitutes middle layer module; Among said step S2 and the S4, the Active X component internal of said middle layer module has the intermediate layer message processing unit, and has the message pool of using Memory Mapping File and its; Said intermediate layer message processing unit is managed said Memory Mapping File and its, makes said contact bed module or functional layer module read or write the content of Memory Mapping File and its.
In the method according to client software operation of the present invention, among said step S2 and the S4, the ActiveX component internal of said middle layer module establishes the asynchronous message transmission interface; The trigger event that said contact bed module and functional layer module are sent and the message of feedback result are used for writing said Memory Mapping File and its through said asynchronous message transmission interface.
In the method according to client software operation of the present invention, among said step S2 and the S4, the ActiveX component internal of said middle layer module establishes message pool monitoring processing unit and self-defined message mapping macro interface; Said message pool monitoring processing unit is used for the monitoring message pond, judges whether to detect effective message; Said intermediate layer message processing unit shines upon macro interface when message pool monitoring processing unit monitors efficient message through said self-defined message, corresponding contact bed module or the functional layer module of being transmitted to.
The system and method for the client software operation of embodiment of the present invention; Have following beneficial effect: the present invention utilizes the ActiveX assembly of Microsoft can be simultaneously by the characteristics of client software with the script use; In conjunction with the advantage of Html design interface element, through the forwarding of ActiveX assembly realization message, both response interface changes fast; Can satisfy highly difficult interface element design again, also not influence its mutual dirigibility.And can in ActiveX, use Memory Mapping File and its to carry out communication as the functional layer of the window application of client end interface and the message pool of Html interface element.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.
See also Fig. 1, be the module diagram of the system of client software operation in according to a preferred embodiment of the invention.As shown in Figure 1, the system of this client software operation comprises the contact bed module 10 and functional layer module 20 of human window application program, and the middle layer module 30 that is made up of Active X assembly.
Constructive process in the face of client software provided by the invention specifies down, may further comprise the steps:
Step 1: at first use window application based on Windows operating system as program frame, promptly design a window application of supporting Html.With MFC is example, uses guide to generate a dialog box program, selects " use html dialog " option.
Step 2: use the mode of the Html+JavaScript interface of designing program, it comprises: use the html language to carry out the layout of software interface element, use JavaScript assist the mutual effect of realization.The Html webpage that has designed is embedded in the window application framework of design in the step 1;
Step 3: create the ActiveX assembly, as the communication middleware of window application framework and Html webpage.With MFC is example, in guide, selects MFC/MFC ActiveX Control.After the ActiveX assembly was accomplished in design, to Windows operating system, this interface just can be called use ActiveX assembly by window application and Html+JavaScript like this with this ActiveX component register.
After above-mentioned client software INTERFACE DESIGN based on web was accomplished, the client software interface that this has designed showed with the Html form web page, and is designed to the outward appearance at client software interface.Can be after having designed through system's this client software of operation of client software operation as shown in Figure 1.
The contact bed module 10 of window application is used to move the Html code that embeds window application and generates the client software interface.This contact bed module 10 is also caught the trigger event on this client software interface through the JavaScript code that embeds window application, and the message of the trigger event that obtains is transmitted to the functional layer module 20 of window application through the Active X assembly of middle layer module 30.
The functional layer module 20 of window application is carried out the Message Processing code of window application according to the message of trigger event; Obtain feedback result, and the contact bed module 20 that the message of the feedback result Active X assembly through middle layer module 30 is transmitted to window application is shown through the client software interface.
In the system of client software operation provided by the invention, middle layer module 30 is to adopt Memory Mapping File and its 32 as message pool.When creating software, in the ActiveX assembly, use Memory Mapping File and its as message pool, be used for the reception and the transmission of administrative messag and the exchange of partial data.Be specially component internal, distribute a memory headroom, use this space to generate Memory Mapping File and its at ActiveX.The ActiveX assembly also has intermediate layer message processing unit 31, is managed by 31 pairs of Memory Mapping File and its 32 of intermediate layer message processing unit, makes the content of contact bed module 10 and 20 pairs of Memory Mapping File and its of functional layer module read or write.The form that content wherein can be appointed according to the Html webpage of functional layer module 20 and contact bed module 10 is called communications protocol, resolves.
The ActiveX component internal of middle layer module 30 establishes asynchronous message transmission interface (PostMessage interface) and realizes the message write-in functions.The function of its realization writes the message body of appointing form to Memory Mapping File and its 32 (being message pool) exactly.Be that contact bed module 10 is used for writing said Memory Mapping File and its through this PostMessage interface with the trigger event of functional layer module 30 transmissions and the message of feedback result.
The ActiveX component internal of middle layer module 30 also establishes message pool monitoring processing unit and self-defined message mapping macro interface (OnMessage interface).This message pool monitoring processing unit is used to monitor the Memory Mapping File and its as message pool, judges whether to detect effective message.Intermediate layer message processing unit 31 through this OnMessage interface when message pool monitoring processing unit monitors efficient message, corresponding contact bed module 10 or the functional layer module 20 of being transmitted to.
See also Fig. 1, contact bed module 10 further comprises: Html unit 13, JavaScript unit 12 and contact bed message processing unit 11.
Wherein, the said Html unit 13 Html code that is used to move above-mentioned embedding window application generates the client software interface of Html form web page.And Html unit 13 also shows through changing the client software interface after the message of the feedback result of the functional layer module 20 that receives middle layer module 30 forwardings.
JavaScript unit 12 is used for through the trigger event on the client software interface of the JavaScript code seizure Html form web page that embeds window application, for example mouse event.For example, the user clicks the button of a scanning registry error on the client software interface that the Html webpage has promptly designed.JavaScript unit 12 captures this mouse event, through the message of event response function generation trigger event, like the message of MSG_SCAN_REGISTER_ERR (self-defined message can be character string).
Contact bed message processing unit 11; Link to each other with Html unit 13, JavaScript unit 12 and intermediate layer message processing unit 31; The forwards of the trigger event that JavaScript unit 12 is obtained is given intermediate layer message processing unit 31, through the PostMessage interface message of this trigger event is write message pool in the activex component internal by intermediate layer message processing unit 31 again.Contact bed message processing unit 13 also will be from the middle layer message of the feedback result that obtains through the OnMessage interface of message processing unit 31 send to Html unit 13 and show.
Functional layer module 20 further comprises: functional layer message processing unit 21 and message performance element 22.Wherein, functional layer message processing unit 21 links to each other with message performance element 22 with intermediate layer message processing unit 31, and the message of the trigger event that is used for the message processing unit 31 from the middle layer is obtained through the OnMessage interface sends to message performance element 22.Receive the message of this trigger event again by this message performance element 22; For example determining is the instruction of a scanning registry error, carries out the Message Processing code of window application, promptly carries out registration table scanning; And the message of generation feedback result, like SCAN_FINISH message.Scanning is accomplished, and the functional layer message processing unit 21 of functional layer module 20 writes this SCAN_FINISH message through the PostMessage interface of intermediate layer message processing unit 31 in message pool (Memory Mapping File and its).
The detailed process of facing the method for client software operation of the present invention down describes.This client software also need be through aforesaid client software the step of constructive process create.The client software interface that this has designed shows with the Html form web page, and is designed to the outward appearance at client software interface.Can be after having designed through this client software of method operation of following client software operation.
At first; In step S1; The html code that the contact bed module operation of window application embeds window application generates the client software interface, and catches the trigger event on this client software interface through the JavaScript code that embeds window application.
Subsequently, in step S2, the contact bed module is transmitted to the message of the trigger event that obtains the functional layer module of window application through Active X assembly.
Subsequently, in step S3, the functional layer module of window application obtains feedback result according to the Message Processing code of the message execution window application of trigger event.
At last, in step S4, functional layer module shows the message of feedback result is transmitted to said window application through Active X assembly contact bed module through said client software interface.
See also Fig. 2, be the particular flow sheet of the method for client software according to the present invention operation.As shown in Figure 2, the concrete steps of the method for this client software operation comprise:
At first, in step S201, the contact bed module is obtained for example mouse event of trigger event through the client software interface that generates with Html.For example, the user clicks the button of a scanning registry error on the client software interface that the Html webpage has promptly designed.The JavaScript unit captures this mouse event, through the message of event response function generation trigger event, like the message of MSG_SCAN_REGISTER_ERR (self-defined message can be character string).The function of the corresponding above-mentioned steps S1 of this step.
Subsequently, in step S202, through the PostMessage interface message of this trigger event is write message pool in the ActiveX component internal.In the method, the middle communication part of middle layer module for constituting by the ActiveX assembly, and adopt Memory Mapping File and its as message pool.When creating software, in the ActiveX assembly, use Memory Mapping File and its as message pool, be used for the reception and the transmission of administrative messag and the exchange of partial data.Be specially component internal, distribute a memory headroom, use this space to generate Memory Mapping File and its at ActiveX.The ActiveX assembly also has the intermediate layer message processing unit, by the intermediate layer message processing unit Memory Mapping File and its is managed, and makes contact bed module and functional layer module read or write the content of Memory Mapping File and its.The form that content wherein can be appointed according to the Html webpage of functional layer module and contact bed module is called communications protocol, resolves.
The ActiveX component internal of middle layer module establishes asynchronous message transmission interface (PostMessage interface) and realizes the message write-in functions.The function of its realization writes the message body of appointing form to Memory Mapping File and its (being message pool) exactly.Be that the trigger event of contact bed module and functional layer module transmission and the message of feedback result are used for writing said Memory Mapping File and its through this PostMessage interface.
Subsequently, in step S203, the intermediate layer message processing unit of middle layer module learns that through the OnMessage interface detecting effective message comes message pool, takes out this message and sends to functional layer module.Step S202 and step S203 have accomplished the function of above-mentioned steps S2.The ActiveX component internal of middle layer module also establishes message pool monitoring processing unit and self-defined message mapping macro interface (OnMessage interface).This message pool monitoring processing unit is used to monitor the Memory Mapping File and its as message pool, judges whether to detect effective message.The intermediate layer message processing unit through this OnMessage interface when message pool monitoring processing unit monitors efficient message, the corresponding functional layer module that is transmitted to.
Subsequently, in step S204, functional layer module receives the message of this trigger event, carries out the Message Processing code of window application, generates the message of feedback result.For example, functional layer module receives the message of this trigger event, and for example determining is the instruction of a scanning registry error; Carry out the Message Processing code of window application; Promptly carry out registration table scanning, and generate the message of feedback result, like SCAN_FINISH message.The function of the corresponding above-mentioned steps S3 of this step.
Subsequently, in step S205, through the PostMessage interface message of this feedback result is write message pool in the activex component internal.For example, write above-mentioned SCAN_FINISH message.
Subsequently, in step S206, the intermediate layer message processing unit learns that through the OnMessage interface detecting effective message comes message pool, and the message of taking out this feedback result sends to the contact bed module.
Subsequently, in step S207, the contact bed module shows the message of the feedback result that receives through said client software interface.Step S205, step S206 and step S207 have accomplished the function of above-mentioned steps S4.
The present invention describes according to specific embodiment, but it will be understood by those skilled in the art that when not breaking away from the scope of the invention, can carry out various variations and be equal to replacement.In addition, for adapting to the specific occasion or the material of the present invention's technology, can carry out many modifications and not break away from its protection domain the present invention.Therefore, the present invention is not limited to specific embodiment disclosed herein, and comprises that all drop into the embodiment of claim protection domain.