By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,262 Members | 2,664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,262 IT Pros & Developers. It's quick & easy.

Winsock control in ASP Page

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.