首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

Vb6.0创建组件 Asp调用出错解决方案

2012-01-24 
Vb6.0创建组件 Asp调用出错我用Vb6.0编写组件first.dll之后注册成功在Asp文件中调用代码如下:Set myDll

Vb6.0创建组件 Asp调用出错
我用Vb6.0编写组件first.dll之后注册成功 
在Asp文件中调用代码如下: 
Set myDll = Server.CreateObject("first.test") 
myDll.sayHello 

错误信息如下: 
Server 对象 错误 'ASP 0177 : 800401f3' 
Server.CreateObject 失败 
/dlltest.asp,行 2 
无效的类别字符串 

请告诉我错误的原因以及解决的办法,非常感谢! 


Dll源代码如下: 
Dim rp As Response 
Dim rq As Request 
Dim ap As Application 
Dim sr As Server 
Dim sn As Session 
Public Sub OnStartPage(Mysc As ScriptingContext) 
Set rp = Mysc.Response 
Set rq = Mysc.Request 
Set ap = Mysc.Application 
Set sr = Mysc.Server 
Set sn = Mysc.Session 
rp.Write ("<strong>ActiveX Dll 组建创建成功,哈哈</strong>") 
End Sub 

Public Sub OnEndPage() 
rp.Write ("Axctive Dll 组件已经销毁") 
Set rp = Nothing 
Set rq = Nothing 
Set sr = Nothing 
Set ap = Nothing 
Set sn = Nothing 

End Sub 
Public Sub SayHello() 
rp.Write ("<h1>Hello World</h1>") 
End Sub

[解决办法]
你类的ProgID不是first.test
[解决办法]

探讨
你怎么知道我的类是ProgID 我又怎么才能知道自己的类的名字?小弟菜鸟 见笑了

[解决办法]
ProgID就等于 “项目名.类名”
[解决办法]
探讨
你怎么知道我的类是ProgID 我又怎么才能知道自己的类的名字?小弟菜鸟 见笑了

[解决办法]
可以用OleView查看

热点排行