Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to create event handles Converting from vfp
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Migration
Titre:
How to create event handles Converting from vfp
Divers
Thread ID:
00889622
Message ID:
00889622
Vues:
48
I use a couple com components that allow for a tcp/ip connection to be created and receive messages, they then parse the message. In VFP I have to use the vfpcom.dll to bind the events and then have a class that handles the events
************************************************************************
* Create the Objects that listen for messages
************************************************************************
ovfpcomm 		= CREATEOBJECT('vfpCom.comutil')
vfpsockevent 	= NEWOBJECT("_IConnectionFactoryEvents")
sockfactory 	= CREATEOBJECT("S2TCPComms.TCPConnectionFactory.1")


...

**************************************************************************
* Here is the message class factory code that is bound to events
**************************************************************************
DEFINE CLASS _IConnectionFactoryEvents AS CUSTOM
	*
PROCEDURE NewConnection
	LPARAMETERS CONNECTION
	WAIT WINDOW NOWAIT 'New Connection'
	msgwindow.edit1.VALUE = 'Started'
	msgwindow.frmMsgCnt = 0
	msgwindow.frmStatus = 'Listening'
	IF glSaveCon
		INSERT INTO plog (transdt,logdesc,messagetxt) VALUES (DATETIME(),'Connection','Connect Created')
	ENDIF 
	msgwindow.REFRESH()
ENDPROC

PROCEDURE NewMessage
 LPARAMETERS CONNECTION
  ... code here to parse message

endproc 
I'm trying to convert this to VB.NET, in the form, I have the following right after the Inherits System.windows.forms.form statement:

Private oSockFactory As New S2TCPCOMMSLib.TCPConnectionFactory
Private oMsgFactory As New SYMPHONIA3ENGINELib.MessageFactory

and then in the form load I have:

Dim iPort As Integer
iPort = Me.txt_PortNumber.Text
oSockFactory.Listen(iPort)

When I run the form, I can create a connection from my test sender to this listner, but I don't know how to structure the events handles to capture when a connection is received and a new message event like I have in VFP.

Thanks for any help.
Répondre
Fil
Voir

Click here to load this message in the networking platform