Document directory
Data Exchange
Javascript data types are not rich in C ++. The best way is to pass data through strings, package and parse the data according to the Conventions. If JavaScript transmits data to ActiveX without Chinese characters, you can directly use char *. The engineering attribute is multi-byte encoding. If ActiveX transmits a string to Javascript, the width character is required...
Mutual call of methods
Javascript calls ActiveX functions most directly. A global ActiveX object is defined in the HTML webpage. js directly uses the Object ID to operate controls. Call a member function by using the external name of the function in ActiveX. The external name of the function is defined as the second string of the disp_function_id macro In the CTRL file. For general interface functions, use disp_function_id.
Ativex calls JS functions, which is somewhat similar to the QT semaphore mechanism. First, declare the event ing in ActiveX. The event function is only a fireevent. In ActiveX, you can call this event function at will. JS implements this function (also using the external name of the event function) to define the behavior of this function. Then, when ActiveX calls this function, it actually calls the JS function. The event function uses the event_custom_id macro.
Data exchange between JS and ActiveX is implemented through mutual calls.
Code download: http://download.csdn.net/source/3476200
Add-2011-8-5
ActiveX controls are the same as DLL controls. When multiple controls are defined in an HTML webpage, their IDs are the same.
These controls share the global variables and global callback functions in the program.. The last modification to global variables takes effect...