Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a dll in vfp that has an OCX
Message
From
30/10/2000 21:01:38
 
 
To
30/10/2000 14:40:12
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00436033
Message ID:
00436186
Views:
19
>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.)
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform