Try AddObject instead:
ThisForm.AddObject( ;
"oleWinsock", ;
"Winsock", ;
"MSWinsock.Winsock")
Make sure you've SET CLASSLIB TO your class library, or SET PROCEDURE TO your .prg.
>i have defined a class in myprog.prg like this.
>
>DEFINE CLASS frmSock AS OleControl
> OleClass = "MSWinsock.Winsock"
>...
>ENDPROC
>
>
>and from a form i wrote
>
>This.NewObject('sock', 'frmSock','myprog.prg')
>
>the problem is that vfp 6 doesn't creat the winsock object directly but shows the insert object form (the form that is used to show installed ocx file)
>
>why ?