我做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 '建立自定義函數(shù)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 我的操作系統(tǒng)是WINDOWS 2003,IIS 6.0,已經(jīng)安裝MYSQL,MSSQL,MY DOBC 3.5 VB 6.0 別的什么都沒有裝,搞了一晚上也沒有搞出來哪位高手幫幫忙~~
- 2 回答
- 0 關注
- 194 瀏覽
添加回答
舉報
0/150
提交
取消