Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Winsock/ActiveX Dll problem in ASP

Status
Not open for further replies.

datavalue

Programmer
Nov 8, 2002
12
CA
I have written an ActiveX dll in VB that uses the Winsock.dll (I tried the mswinsck.ocx first but have the same problem). It is called MyPriceTcpApp.dll with a class called TCPIP.

I am trying to creating an object to use my code within ASP.

eg
<%
Dim lPrices
Dim lWinTcp

Set lWinTcp = Server.CreateObject(&quot;MyPriceTcpApp.TCPIP&quot;)
lWinTcp.Host = &quot;158.23.2.3&quot;
lWinTcp.Port = &quot;56595&quot;
lWinTcp.Command = &quot;GET PRICE FORDCAR&quot;
lWinTcp.Execute
lPrices = lWinTcp.GetData

Response.Write &quot;Price is &quot; & lPrices
Set lWinTcp = nothing
%>

My Asp app hangs when I perform the execute. I see the progress bar increase but nothing happens. The command isn't being sent to the pricesserver.

The MyPriceTcpApp works when I run the code in a VB test app and it works on the server when I run it as a .vbs file
So why should it hang as an ASP component? I thought it was a Winsock problem hence the rewrite from MSWINSCK.OCX to the native API calls in WINSOCK.DLL and a microsoft site said the OCX should not be used in IIS applications. But it works as a VBS script. So it cant be a winsock issue or can it?

I have registered the MyPriceTcpApp.dll on the server using REGSVR32 and I can see it in OLEVIEW.

My server is a Windows 2000 server running IIS.

If I can't get this working how else could I send a message and get a response from a port on a server into a webpage?

(The prices string/variant when it comes back from the dll is actually an XML string but I've simplified the example code.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top