关于自定义动态库在vb中调用成功,在asp中调用失败
在网上看到有朋友提出同样问题,但未获得有效帮助,特整理自己的问题,希望高手能够解决
在vb6中创建activex dll,项目名称为TransByteToString,类名为Transfer,具体功能是将数组转换成字符串,代码如下:
Public Function ByteToStr(ByteSource())
Dim result
Dim tempArray() As Byte
If UBound(ByteSource) > 0 Then
ReDim tempArray(UBound(ByteSource))
For i = 0 To UBound(tempArray) - 1
tempArray(i) = CByte(ByteSource(i))
Next
result = StrConv(tempArray, vbNarrow)
Else
result = ""
End If
ByteToStr = result
End Function
传入参数为varient类型的数组,通过ByteToStr方法将数组转换成字符串,该dll生成并注册后,通过vb调用成功了,但在asp中调用出现错误,比如代码为:
set obj=server.createobject("TransByteToString.Transfer")
strString=obj.ByteToStr(输入的数组)
当运行到上面代码的“strString=obj.ByteToStr(输入的数组)” 报出“类型不匹配 obj.ByteToStr'' was not handled.” 希望各位高手帮助。