-
I am trying to initialize a WIinsock control in an ActiveX DLL By creating an instance of it in ASP and Callinga Connect Function in the Class .. this function is supposed to Open a winsock Connection to a certain IP and Port and wait for an Approoval ...
But it keeps giving me the Error : Obejct variable not set ... I know My ASP Code is not wrong .. so the Error is most probably from the DLL ... how can I slove that ??
- Thans in advance -
-
Whats the error number? And error description? Are other com components working on this machine? Are you using PWS or IIS?
-
I am using PWS and the error is :
Code:
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/recon/Default.asp, line 3
800401f3
Here is the ASP Code :
Code:
<%
dim obj
set obj = server.createobject ("Socket2.Connect")
response.write obj.Connect("192.168.3.56",2001)
response.write obj.send("ssss")
set opj = nothing
%>
-
Is the DLL registered on the server? Can you instantiate it with a VB App?
-
Yes I could when I first wrote and compiled and then Regirtered the Dll ... but then it used to give me when called from ASP as I decribed abov e this error :" Obejct variable not set "
I dont know what is wrong now It tells me Cannot Create Object ...
-
-
I think your error may casue by the obj.send("ssss") command. You should wait for the Connect event before you can really send something out with the Winsock.
And you no need to set your Obj to nothing in ASP code, this because ASP will automatically release the Object upon completed running the page code.
Code:
<%
dim obj
set obj = server.createobject ("Socket2.Connect")
response.write obj.Connect("192.168.3.56",2001)
**Your COM should be able to notified you either it successful connected to the remote PC before you can proceed to next statement.
response.write obj.send("ssss")
--> set opj = nothing (Should be remove)
%>