COM 方法结果未显示正确的值
我的 COM 组件中有以下方法调用。该方法是从 VBScript 调用的。
STDMETHODIMP CMyInterface::TestX(VARIANT* myTest)
{
myTest->vt = VT_I4;
myTest->lVal = m_nCount;
++m_nCount;
return S_OK;
}
以下代码用于调用该方法。但最后一条语句' Response.Write("Value of result" & result)'
没有打印0。 可能是什么问题?
Set myObject = CreateObject("MyCom.MyInterface")
result=myObject.TestX(value)
Response.Write("Value of result" & result)
I have the following method call in my COM component. This method is called from VBScript.
STDMETHODIMP CMyInterface::TestX(VARIANT* myTest)
{
myTest->vt = VT_I4;
myTest->lVal = m_nCount;
++m_nCount;
return S_OK;
}
The following code is used to invoke the method. But the last statement ' Response.Write("Value of result" & result)'
is not printing 0. What could be the problem?
Set myObject = CreateObject("MyCom.MyInterface")
result=myObject.TestX(value)
Response.Write("Value of result" & result)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
脚本客户端不会将 HRESULT 视为方法调用的返回值。相反,它们会查找 IDL 中标记为 [out, retval] 的参数,并将其用作返回值。
Scripting clients don't consider the HRESULT to be the return value of a method call. Instead, they look for a parameter marked in the IDL as [out, retval] and use that as the return value.