文件名称:C++调用JavaScript
文件大小:46KB
文件格式:RAR
更新时间:2015-04-21 10:34:59
JavaScript Calls from C++
Sometimes, when we are using the IE Browser Control inside of a C++ application, we need to access the HTML elements. We can do it by using standard COM objects such as IWebBrowser2, IHTMLDocument2, and so forth. By doing this, we easily can implement features such as click button, click anchor, get input string, get HTML text, and so on. Unfortunately, Microsoft did not provide similar objects for JavaScript. In any case, it is possible to make a control for the JavaScript object inside an HTML page by using a traditional COM approach. This article describes the class CWebPage that allows you to do it and a technique to call a JavaScript function from C++ code Thanks:http://www.codeguru.com/ieprogram/JSCalls.html
【文件预览】:
JSCalls_demo
----JSCalls()
--------resource.h(1KB)
--------ChildFrm.cpp(4KB)
--------JSCall.dsw(537B)
--------WebPage.cpp(6KB)
--------JSCallView.h(2KB)
--------CallJScriptDlg.h(1KB)
--------JSCall.rc(14KB)
--------JSCallView.cpp(4KB)
--------NavigateBar.h(1KB)
--------JSCallDoc.h(2KB)
--------JSCall.opt(53KB)
--------ReadMe.txt(5KB)
--------LeftView.h(2KB)
--------res()
--------JSCall.dsp(5KB)
--------NavigateBar.cpp(2KB)
--------WebPage.h(2KB)
--------JSCall.ncb(65KB)
--------JSCallDoc.cpp(4KB)
--------MainFrm.h(2KB)
--------JSCall.clw(4KB)
--------JSCall.h(1KB)
--------StdAfx.cpp(208B)
--------JSCall.plg(3KB)
--------CallJScriptDlg.cpp(2KB)
--------ChildFrm.h(2KB)
--------MainFrm.cpp(3KB)
--------JSCall.cpp(5KB)
--------StdAfx.h(1KB)
--------LeftView.cpp(6KB)
JSCalls_src
----WebPage.cpp(6KB)
----WebPage.h(2KB)