> What i can say to you is : your class definition is perfect.
> You can verify that with the object browser (vfp menu/tools/object browser).
> Checking the activeX Winsock.ocx you can see its architecture.
> Dragging the interface DMSWinsockControlEvents into an open prg file you obtain the complet code and its absolutly identical with what you have.
>

>
>
> Dont rate please.its only for the pleasure to help.Give me only a feed back.
> Yousfi Benameur
The event definition was made by the object browser.
But I think it wasn't 100% correctly.
I found the solution after a little bit trying. Now it works.
I commented the lines which were changed.
RELEASE ALL
myWinsockServerEvents=NEWOBJECT("WinsockServerEvents")
myWinsockServer=NEWOBJECT("MSWinsock.Winsock.1") &&here I changed MSWinsock.Winsock to MSWinsock.Winsock.1
EVENTHANDLER(myWinsockServer,myWinsockServerEvents,.T.)
myWinsockServer.LocalPort="1112"
myWinsockServer.Listen()
**
myWinsockClient=NEWOBJECT("MSWinsock.Winsock.1") &&here I changed MSWinsock.Winsock to MSWinsock.Winsock.1
myWinsockClient.Connect("192.168.20.108","1112")
myWinsockClient.Close
DEFINE CLASS WinsockServerEvents AS session OLEPUBLIC
IMPLEMENTS DMSWinsockControlEvents IN MSWinsock.Winsock.1 &&here I changed "c:\windows\system32\mswinsck.ocx" to MSWinsock.Winsock.1
PROCEDURE DMSWinsockControlEvents_Error(Number AS INTEGER, Description AS STRING, Scode AS Number, Source AS STRING, HelpFile AS STRING, HelpContext AS Number, CancelDisplay AS LOGICAL) AS VOID;
HELPSTRING "Error occurred"
* add user code here
ENDPROC
PROCEDURE DMSWinsockControlEvents_DataArrival(bytesTotal AS Number) AS VOID;
HELPSTRING "Occurs when data has been received from the remote computer"
* add user code here
ENDPROC
PROCEDURE DMSWinsockControlEvents_Connect() AS VOID;
HELPSTRING "Occurs connect operation is completed"
* add user code here
ENDPROC
PROCEDURE DMSWinsockControlEvents_ConnectionRequest(requestID AS Number) AS VOID;
HELPSTRING "Occurs when a remote client is attempting to connect"
MESSAGEBOX(requestID)
* add user code here
ENDPROC
PROCEDURE DMSWinsockControlEvents_Close() AS VOID;
HELPSTRING "Occurs when the connection has been closed"
* add user code here
ENDPROC
PROCEDURE DMSWinsockControlEvents_SendProgress(bytesSent AS Number, bytesRemaining AS Number) AS VOID;
HELPSTRING "Occurs during process of sending data"
* add user code here
ENDPROC
PROCEDURE DMSWinsockControlEvents_SendComplete() AS VOID;
HELPSTRING "Occurs after a send operation has completed"
* add user code here
ENDPROC
ENDDEFINE