How to accelerate ScriptControl's procedure call in VC 6.0?

本文介绍了使用VC6.0开发支持脚本的程序时如何利用ScriptControl组件提高脚本过程调用的速度。提供了三条建议:一是尽量使用Run方法代替Eval;二是在可能的情况下预先创建参数结构;三是使用SafeArrayAccessData写入参数值到SAFEARRAY,并在完成后使用SafeArrayUnaccessData。

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 whenfunctions (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.

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值