473,382 Members | 1,238 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,382 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 9290
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.