Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Correct way to implement MSWinsock.ocx
Message
From
27/09/2001 16:36:27
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Correct way to implement MSWinsock.ocx
Miscellaneous
Thread ID:
00561678
Message ID:
00561678
Views:
82
Hi;

I'm trying to figure out a respectable way to use MSWinsock.ocx.

I would like to subclass it as container object in such a way that all the properties and methods are exposed, and the events call corresponding methods in my container...which I could then override in subesquent subclasses.

I would like to do this all non-visually, if possible.

So far, I have been exploring the following possibilities:

-----------------------------------------------------------
Brute force mapping of events to the container's methods, the container's methods to the MSWinsock methods, and using Access/assign methods to handle the properties...something like this:
DEFINE CLASS my_WinSock AS Container
	ADD OBJECT oMSWinSock AS MSWinSock
	
	FUNCTION ConnectionRequest
	LPARAMETERS (requestid)

	ENDFUNC
	
ENDDEFINE

DEFINE CLASS MSWinsock AS OLEControl
	oleClass=[MSWinsock.Winsock.1]
	
	FUNCTION ConnectionRequest
	LPARAMETERS requestid
		This.Parent.ConnectionRequest(requestid)
	ENDFUNC

ENDDEFINE
...which seems really tedious.


-----------------------------------------------------------------------
Another method I was checking out was using the IMPLEMENTS keyword in define class. However, I don't have a very good understanding of what this keyword DOES. It would seem that it is what I'm after, but I don't quite grasp it.

In the TypeLib viewer, the MSWinsock control has two interfaces DMSWinsockControlEvents and IMSWinsockControl

DMSWinsockControlEvents has all the events in it...but no Properties or methods. Dragging this one into a code window gets me a class definition that will work...but I can't change any properties or call methods.

IMSWinsockControl has the properties and methods, but no events, and it throws an error when I try to instantiate the object.


Any help would be greatly appreciated.

Russ
Next
Reply
Map
View

Click here to load this message in the networking platform