关于网友提出的“ VBscript调用dll vc atl”问题疑问,本网通过在网上对“ VBscript调用dll vc atl”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: VBscript调用dll vc atl
描述: 我用vc6 atl写了一个dll,然后在asp里面调用,用下面的方法可以:
<%
dim rtv
set a=server.createobject("Code.Str")
rtv=a.Decode("abcd")
response.write rtv
%>
但是改成用变量就不行了:
<%
dim str,rtv
set a=server.createobject("Code.Str")
str="abcd"
rtv=a.Decode(str)
response.write rtv
%>
反而提示
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'a.Decode'
/test/testdll.asp, line 5
在VC的定义是
[id(1), helpstring("method Decode")] HRESULT Decode([in] VARIANT RawStr,[out,retval] VARIANT * Result);
谁能帮帮我?
解决方案1: 这样看看,dim放同一行,也许编译器认为两者类型一样
<%
dim str
dim rtv
set a=server.createobject("Code.Str")
str="abcd"
rtv=a.Decode(str)
response.write rtv
%>
以上介绍了“ VBscript调用dll vc atl”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/3666720.html
相关图片
相关文章