PRB: Using the Internet Transfer Control on an ASP PageID: Q216288
|
When using the Internet Transfer Control on an Active Server Pages (ASP) page that has been deployed on a remote Web server and the remote Web server does not have Visual Basic installed, the following error message occurs when accessing the ASP page:
Server object error 'ASP 0177 : 80040112'
Server.CreateObject Failed
/WebAppRoot/ASPPage.asp, line xx
This problem occurs because the Internet Transfer Control is a licensed control and ASP page does not have the mechanisms to invoke the License Manager for the licensed control.
To resolve this problem, encapsulate the ActiveX control in an in-process, ActiveX component (a dynamic-link library, or DLL) that allows the Internet Transfer Control to be redistributed and allows the deployment of the control to the remote Web server.
The following instructions demonstrate how to encapsulate the Internet Transfer Control within a Visual Basic in-process, ActiveX component:
Private objForm As Object
Private Sub Class_Initialize()
Set objForm = New Form1
End Sub
Public Function OpenURL(strURL As String)
OpenURL = objForm.Inet1.OpenURL(strURL)
End Function
Public Property Let RequestTimeOut(intRTO As Integer)
objForm.Inet1.RequestTimeOut = intRTO
End Property
Public Property Get RequestTimeOut() As Integer
RequestTimeOut = objForm.Inet1.RequestTimeOut
End Property
Regsvr32 MSINET.OCX [Enter]
Regsvr32 Project1.dll [Enter]
<%@ Language="VBScript" %>
<%
Response.Buffer = true
set objInetTransCtrl = Server.CreateObject("Project1.Class1")
strPage = objInetTransCtrl.OpenURL("http://msdn.microsoft.com/vinterdev") 'substitute your URL here
Response.Write strPage
%>
This behavior is by design.
Using the Internet Transfer Control or any other ActiveX controls on an ASP page with server-side script is not supported by Microsoft. ActiveX controls are designed to be run on a client application such as a Web browser (Internet Explorer) or on a Visual Basic form. These controls have events that may require user interaction. Since ASP is processed on the Web server, there is no user interaction to respond to these events when the events are executed by the controls. Hence, other issues may occur when the controls execute their events and require user interaction.
If this should happen with the encapsulated Internet Transfer Control on an ASP page, you may have to create another ActiveX component that uses the WinInet Application Program Interface (API).
Please refer to the following Web sites for more related information:
http://msdn.microsoft.com/vinterdev/
http://msdn.microsoft.com/vbasic/
Additional query words:
Keywords : kbActiveX kbASP kbVBp600 kbVisID600 kbGrpASP
Version : WINDOWS:5.0,6.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: June 16, 1999