Hello and thanks for the help.

I am looking at some sample code which works but there is an element of the
syntax which is confusing. The code is:

ThisForm.tcpServer.Object.LocalPort = 1001
ThisForm.tcpServer.Object.Listen

where tcpServer refers to an instance of the Winsock control. Why is the
.Object in this code? What is the difference between
Thisform.tcpServer.Object.LocalPort and Thisform.TcpServer.LocalPort?

Thanks again,
Jeff

Re: Confused by sample code by Dan

Dan
Fri Aug 11 10:29:20 CDT 2006

When you put an ActiveX control (like Winsock) on a form, it actually goes
inside a VFP OLEControl which is basically a form of container. The control
itself may or may not surface its properties through the containership
model. In this case, it isn't.

You use the object keyword to refer to the ActiveX control living inside
this VFP OLEControl.

Dan

Jeff Grippe wrote:
> Hello and thanks for the help.
>
> I am looking at some sample code which works but there is an element
> of the syntax which is confusing. The code is:
>
> ThisForm.tcpServer.Object.LocalPort = 1001
> ThisForm.tcpServer.Object.Listen
>
> where tcpServer refers to an instance of the Winsock control. Why is
> the .Object in this code? What is the difference between
> Thisform.tcpServer.Object.LocalPort and Thisform.TcpServer.LocalPort?
>
> Thanks again,
> Jeff