Raymond
asked on
Compile Error: New Winsock
Compile error:
Private Sub Class_Initialize()
Set theSock = New Winsock <------error
End Sub
"Compile error: Invaild use of New keyword"
I have another Form that has another Winsock control, do you think this caused the problem? How can I fix this?
Thank You!
raymng
Private Sub Class_Initialize()
Set theSock = New Winsock <------error
End Sub
"Compile error: Invaild use of New keyword"
I have another Form that has another Winsock control, do you think this caused the problem? How can I fix this?
Thank You!
raymng
ASKER
bfeddish,
Class Module:
-------------------------- -------
Private Sub Class_Initialize()
Set theSock = New Winsock <------error
End Sub
Main Form:
-------------------------- -------
I have placed another Winsock control on the main form.
raymng
Class Module:
--------------------------
Private Sub Class_Initialize()
Set theSock = New Winsock <------error
End Sub
Main Form:
--------------------------
I have placed another Winsock control on the main form.
raymng
Is theSock the control name?
ASKER
No, the Winsock control located in the Main Form is called sckDn.
If I'm not mistaken, you can just start using the control referenced by it's name. For example sckDn.Connect(), etc. I don't think you need to instantiate another reference to it.
ASKER
bfeddish:
I need two different Winsock, sckDn is on the Main Form whereas theSock is on the class module. I can use sckDn without problem, but theSock has problem.
Class Module:
-------------------------- -------
Private Sub Class_Initialize()
Set theSock = New Winsock <------error
End Sub
raymng
I need two different Winsock, sckDn is on the Main Form whereas theSock is on the class module. I can use sckDn without problem, but theSock has problem.
Class Module:
--------------------------
Private Sub Class_Initialize()
Set theSock = New Winsock <------error
End Sub
raymng
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx very much!
Are you sure you are using the New keyword to instatiate the winsock in your working application? If you are using the built in control there is no need to instantiate it.