小弟写了个DLL代码如下:
Public Function getstr()
hlos = "This is server Activex"
End Function
后来想在ASP中调用是这样写的:
<%Set obj1=Server.CreateObject("xuweis.getstr")
xuweistr=obj1.hlos
REsponse.Write(xuweistr)%>
上面这样写有错吗?
为什么会提示创建对象失败,请教各位大哥大姐。
Public Function getstr()
hlos = "This is server Activex"
End Function
后来想在ASP中调用是这样写的:
<%Set obj1=Server.CreateObject("xuweis.getstr")
xuweistr=obj1.hlos
REsponse.Write(xuweistr)%>
上面这样写有错吗?
为什么会提示创建对象失败,请教各位大哥大姐。
<%Set obj1=Server.CreateObject("你的工程.类名")
xuweistr=obj1.getstr
REsponse.Write(xuweistr)%>
下面的也有错误:
Public Function getstr()
hlos = "This is server Activex"
End Function
改为:
Public Function getstr() as string
getstr = "This is server Activex"
End Function
<%Set obj1=Server.CreateObject("xuweis.getstr")
obj1.getstr
xuweistr=obj1.hlos
REsponse.Write(xuweistr)%>也可以象楼上那样改.
这里也是得和楼上说的一样.
表示已经参与