gpt4 book ai didi

c++ - 错误 : Variable uses an Automation Type not supported in VBScript

转载 作者:行者123 更新时间:2023-11-30 02:29:26 25 4
gpt4 key购买 nike

我正在使用 Microsoft 脚本控件(IScriptControlPtr 接口(interface))在 C++ 中执行 VBScript 函数。

VBScript 函数:

Function Add1(a,b)
Add1 = a+b
End Function

我需要将无符号长值传递给参数 ab

所以我将参数数据类型指定为 VT_UI4。但是在执行该函数时出现错误“变量使用 VBScript 不支持的自动化类型”。

根据我的要求,如何处理 unsigned long 值?

最佳答案

VBScript 仅支持带符号的 2 字节和 4 字节整数。因此,您必须将参数更改为 VT_I4,或使用类型转换函数,如 UnsignedToLongLongToUnsigned。有关其他信息,请参阅下文。

关于c++ - 错误 : Variable uses an Automation Type not supported in VBScript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39443678/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com