473,288 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

Winsock control in ASP Page

Hello all !
I wrote a simple ActiveX DLL to wrap winsock functionality so I can
use it in an ASP page.

I call it MyWinSock

In the Class module I use this declaration:

Dim ctlSocket as Variant.

In the Class_Initialize() I wrote the following:

Set ctlSocket = CreateObject("MSWinsock.Winsock")

Now the problem is: When I make an instance of the class MyWinSock
from another VB program - everything works fine.

When I make an instance of it from IIS on my computer via ASP page -
it works fine.

When I try to make an instance of it from an ASP page located on
another computer via its IIS I get an error:

"MyWinSock (0x800A01AD)
ActiveX component can't create object"

As far as I could understand the error occures when MyWinSock trys to
make an instance of the Winsock object. If I don't try to make an
instance of the Winsock control everything is OK.

I registered the component in the remote computer and checked that all
registery entries for it are correct.

Any help will be appriciated.

Thanks
Ophir.
Jul 19 '05 #1
4 9274
On 25 Feb 2004 05:45:12 -0800, Ophir <op*****@netvision.net.il> wrote:
When I try to make an instance of it from an ASP page located on
another computer via its IIS I get an error:

"MyWinSock (0x800A01AD)
ActiveX component can't create object"


did you make sure the MSWinsock component is also registered on the server?

take a look at the discussion on this page. it may give you some ideas.
http://www.experts-exchange.com/Prog..._20848674.html
jenny
Jul 19 '05 #2
jenny mabe <ne**@rabidduck.com> wrote in message news:<opr3xw2ei5qafk40@localhost>...
On 25 Feb 2004 05:45:12 -0800, Ophir <op*****@netvision.net.il> wrote:
When I try to make an instance of it from an ASP page located on
another computer via its IIS I get an error:

"MyWinSock (0x800A01AD)
ActiveX component can't create object"


did you make sure the MSWinsock component is also registered on the serv
er?

take a look at the discussion on this page. it may give you some ideas.
http://www.experts-exchange.com/Programming/Programming Languages/Visual
Basic/Q 20848674.html
jenny

Jenny thanks for the reply.
I sure did make sure that the MSWinsoc is registered on the server computer.
I also use winsock on that computer in other applications and it works fine.
Anymore ideas?
Ophir.
Jul 19 '05 #3
On 25 Feb 2004 23:33:49 -0800, Ophir <op*****@netvision.net.il> wrote:
I sure did make sure that the MSWinsoc is registered on the server
computer. I also use winsock on that computer in other applications and
it works fine. Anymore ideas?


Can you post the code from the ASP page?
Jenny
Jul 19 '05 #4
jenny mabe <ne**@rabidduck.com> wrote in message news:<opr3yvfub4qafk40@localhost>...
On 25 Feb 2004 23:33:49 -0800, Ophir <op*****@netvision.net.il> wrote:
I sure did make sure that the MSWinsoc is registered on the server

computer. I also use winsock on that computer in other applications an

d
it works fine. Anymore ideas?


Can you post the code from the ASP page?
Jenny


Jenny here is the code:

dim strValueToSend,ctlSocket,strInData,strTemp,counter ,strIP,strPort,strWait
Response.Expires = -1000
strValueToSend = Request.QueryString("ATI")

strIP = Request.QueryString("IP")

strPort = Request.QueryString("Port")

strWait = Request.QueryString("Wait")

'Response.Write "Value is before sock : " & strValueToSend & "<BR>"

if strValueToSend <> "" then
set ctlSocket = Server.CreateObject("ConSockLib.ConSock")
'set ctlSocket = Server.CreateObject("MSWinsock.Winsock")
if not ctlSocket.ConnectSock (strIP,Clng(strPort)) then
Response.Write "Failed to connect"
else
'Response.Write "Value is : " & strValueToSend & "<BR>"
ctlSocket.ConSendData strValueToSend & vbCr
do while InStr(1,strInData,strWait,vbTextCompare) = 0 and counter < 500000
counter = counter + 1
ctlSocket.ConGetData strTemp
strInData = strInData & strTemp
ctlSocket.ConDoEvents
loop
ctlSocket.CloseSock
'Response.Write "<PRE>Return value is: " & vbCrLf & strInData & "<PRE>"
end if
set ctlSocket = nothing
end if
if IsObject(ctlSocket) then
set ctlSocket = nothing
end if
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Niels Borg | last post by:
Hi, I'm writing app where I use WinSock, but I have experienced a problem. WinSock only sends the data after finishing the calling sub/function. Can I force WinSock immediately as I need to send...
8
by: C. Alexander | last post by:
Im running a small server that seems to work fine outside the IDE as an exe, but within the IDE, when I run the program for the first time, i can start/stop the host many times. But I end the...
3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
1
by: Yu Chai | last post by:
Hi guys, I created a ASP page that 1. users can run when WinSock proxy are using (ie's one is unchecked) 2. users can't run when WinSock proxy are using (ie's one is checked) 3. users can't run...
3
by: John | last post by:
Hello, I currently have Visual Basic .NET 2003 Standard Edition. I would like to develop a standard exe which should use the Winsock Control for VB.NET. I found some tutorials about it, started...
5
by: kc | last post by:
Hi Just upgrading a app from VB6 to VB.Net. All is going well apart from the Winsock control. The first thing we notice is that there does not appear to be a .Net version (please correct me if...
2
by: Mark | last post by:
Hi, I have a VB6 project that uses a winsock control to receive text messages over a UDP connection. It used to work fine. However, when I changed the code to make it more efficient (ie, less...
1
by: kimiraikkonen | last post by:
Hi, As you know there's no mswinsck.ocx ActiveX control in VB.NET 2005 or 08 by default, but it exists in VB6. However i can add this old control to my VB 2005 toolbox with no problem by...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.