vfb运行js

利用mshtml在visual free basic里执行js.

#include once "Afx/CDispInvoke.inc"
DIM pdom AS CDispInvoke = "HTMLFILE"
IF pdom.DispPtr = NULL THEN END Else  Print "成功运行"
DIM oWin AS CDispInvoke = pdom.Invoke("parentWindow")
IF oWin.DispPtr  THEN 
   oWin.Invoke("execScript","var a=1+2;var js={""姓名"":""刘德华"",""年龄"":59},nm=js[‘姓名‘];")
   Print owin.get("a")
   Print cwstr(owin.get("nm"),CP_UTF8)
END IF

 

运行结果:

vfb运行js

vfb运行js

上一篇:修改网站为(黑白)灰色代码


下一篇:Ubuntu编译Android源码步骤