我做DLL的具体过程如下: 1、打开VB6,新建ActiveX DLL 2、在工程引用中加入Microsoft Active Server Pages Object Library选择 3、填加如下代码到CLASS里面: 1、打开VB6,新建ActiveX DLL 2、在工程引用中加入Microsoft Active Server Pages Object Library选择 3、填加代码如下: 'Code Start '声明部分 Private MyScriptingContext As ScriptingContext Private MyApplication As Application Private MyRequest As Request Private MyResponse As Response Private MyServer As Server Private MySession As Session Public Sub OnStartPage(PassedScriptingContext As ScriptingContext) Set MyScriptingContext = PassedScriptingContext Set MyApplication = MyScriptingContext.Application Set MyRequest = MyScriptingContext.Request Set MyResponse = MyScriptingContext.Response Set MyServer = MyScriptingContext.Server Set MySession = MyScriptingContext.Session End Sub Public Sub OnEndPage() Set MyScriptingContext = Nothing Set MyApplication = Nothing Set MyRequest = Nothing Set MyResponse = Nothing Set MyServer = Nothing Set MySession = Nothing End Sub '建立自定义函数SayHello Public Sub SayHello() MyResponse.Write ("Hello World") End Sub 'Code End 4、将类名改为:HelloWorld 将工程名改为:TestVBCode 5、生成TestVBCode.DLL文件,保存至E:\aspdll,并使用Windows运行注册组件命令 Regsvr32 E:\ASPDLL\TestVBCode.DLL注册 6、在本机建立Test.asp文件,代码如下 <% Set MyTestObj = Server.CreateObject("TestVBCode.HelloWorld") MyTestObj .SayHello %> 7、运行test.asp 提示如下: Server 对象 错误 'ASP 0177 : 800401f3' Server.CreateObject 失败 /test.asp,行 6 800401f3 我的操作系统是WINDOWS 2003,IIS 6.0,已经安装MYSQL,MSSQL,MY DOBC 3.5 VB 6.0 别的什么都没有装,搞了一晚上也没有搞出来哪位高手帮帮忙~~
- 2 回答
- 0 关注
- 162 浏览
添加回答
举报
0/150
提交
取消