>Can I drop an OCX into a class and build it as a DLL.
>
>define class mytest as custom olepublic
>lo = creat('mswinsock.winsock.1)
>this.addobject('mywinsock','lo')
>enddefine
>
>can I build above as a DLL?
It doesn't make any sense to do this; AddObject() takes a class reference, not an instance as it's second (or in this case, third) argument. I'd think it would have to look like:
define class mytest as custom olepublic
add object lo AS mswinsock.winsock.1
enddefine
or
define class mytest as custom olepublic
this.addobject('lo',,'mswinsock.winsock.1')
enddefine
The control does publish an event, so VFP might be upset putting this in a .DLL, treating as it would any other control that interacted with the UI. If you want to wrap VFP code around it's events, you need to use VFPCOM to bind a custom class to an instance of the winsock control to bind code to its events (VFPCOM is an add-on that will permit you to bind VFP code to the events of an ActiveX object; it can be downloaded from msdn.microsoft.com/vfoxpro, and there are a couple of whitepapers demonstrating its use to bind to events of the InternetExplorer.Application COM object's events.)