Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem using control whith equivalent to WithEvents
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00512555
Message ID:
00512566
Views:
6
Hi!

VFP do not have ability to late-bind code to the ActiveX control events. You require to use the VFPCOM.DLL that you can find at the MS site.

In addition, to be able to create object using createobject("S2TCPCOMMSLib.IConnection") command, S2TCPCOMMSLib.IConnection should be a registered object on the machine where you call it. If it is remote object (ran from another machine), take a look also to the CreateObjectEx() function.

HTH.

>I am trying to use an OCX “S2TCPComms.dll” but they have sample code only for visual basic.
>When I am trying to use the following code from basic
>
>Public WithEvents sockfactory As TCPConnectionFactory
>Set sockfactory = New TCPConnectionFactory
>
>I don’t have problem to translate for vfoxpro
>
>Sockfactory=createobject(“S2TCPComms.TCPConnectionFactory”)
>
>But when I am trying to use :
>
>Private Sub sockfactory_NewConnection(ByVal connection As S2TCPCOMMSLib.IConnection)
> currPeerName = connection.PeerName
>End Sub
>
>I am getting an error when:
>connection=createobject("S2TCPCOMMSLib.IConnection")
>or
>connection=createobject("S2TCPCOMMS.IConnection")
>
>Class definition not found!
>
>I notice also the they have samples for Delphi with the following notation
>
>“Servers must respond to client events. Unfortunately this is not well handled in Delphi 4. If you are familiar with VB, Delphi does not have an equivalent to VBs ‘Dim WithEvents’ mechanism. However, provided with Symphonia is a package that contains a component with TCP events, that allows you to easily respond to client events. To use it, you must first install the package. The files required to install the package are contained in the ‘Sample\Delphi\DAG Server‘ folder. You can either install the ‘TCPEvents.bpl’ package or install a component using the ‘S2TCPCOMMSLibEvents.pas’ file, as shown below.”
>
>It seems that Fox don’t have access to some of properties or methods of control
>Is there any way to use the control with Visual Foxpro ?
>
>Thanks Nick
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform