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

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.

你可能感兴趣的:(VBScript,vc++)