how to expose variables from msscriptcontrol?

后端 未结 3 1924
迷失自我
迷失自我 2020-12-20 07:33

I\'m trying this for a while now.. is it possible to expose variables and other things to the main script with msscriptcontrol?

example of this control:



        
3条回答
  •  庸人自扰
    2020-12-20 07:38

    The script control can access your program's stuff, specifically objects.

    It's help file should be in system32 folder with Reference, some basic conceptual info, and some small samples.


    Makes run-time functionality available to a scripting engine.

    Syntax

    ScriptControl.AddObject(name, object[, addMembers])
    

    The AddObject method has these parts:

    Part Description

    name Required. Name by which the added object is to be known in ScriptControl code.

    object Required. Name of the object exposed at run time.

    addMembers Optional. Boolean value. True if members of object are globally accessible; False if they are not.

    Remarks

    Use the AddObject method to make run-time functionality available to a scripting engine. The AddObject method enables a ScriptControl user to provide a set of name/object pairs to the scripting code. The scripting engines may expose the name in any way. In both VBScript and JScript, each name appears as a globally accessible name.

提交回复
热议问题