When using VC 6.0 to develope script supported programs, I prefer ScriptControl (msscript.ocx). It supports JScript and VBScript. This is a very good feature. If you decided to use it in your program, the following hints will help you in accelerating your script procedure call.
- 1. use Run method instead of Eval in most cases.
- 2. create the parameter structure in advance if it's possible. I mean the situation when functions (or APIs you designed) are predefined in your program.
- 3. use SafeArrayAccessData to write parameter values to SAFEARRAY. Don't forget to use SafeArrayUnaccessData when finished writing.
Originally writed by Span Zhang.
本文介绍了使用VC6.0开发支持脚本的程序时如何利用ScriptControl组件提高脚本调用效率的方法,包括推荐使用Run方法代替Eval、预先创建参数结构及使用SafeArray进行数据操作等技巧。
3357

被折叠的 条评论
为什么被折叠?



