Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
EventHandler() problems
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
EventHandler() problems
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Divers
Thread ID:
01044248
Message ID:
01044248
Vues:
54
Hello,
I'm working on a project which connects to server and that is made as COM object.
I'm using EventHandler() procedure for connecting COM object (MSWinsock.Winsock.1) and VFP code. The code works fine in App or EXE mode.
If I create COM object, which I call from VBS or PHP, ASP ..., EventHandler() doesn't work correctly, although function EventHandler() returns TRUE. The problem is, that the VFP methods for »MSWinsock.Winsock.1« don't fire.
Some code:
DEFINE CLASS classname AS session OLEPUBLIC
 
FUNCTION tcpconnect
 
oEvents = CreateObject("MSWinsockEvents")
oTcp=CreateObject("MSWinsock.Winsock.1")
 
oEvents.oMSWinsockObject = oTcp
oEvents.oMainObject = This
oEvents.cSporocilo = cTXT
 
EventHandler(oTcp, oEvents) && .t.
 
oTcp.Protocol= 0  && sckTCPProtocol
oTcp.Connect(This.cIP, This.cPort)
…
…
 
RETURN .T.
ENDDEFINE
 
 
 
Define Class MSWinsockEvents As Session olepublic
   Implements DMSWinsockControlEvents In MSWinsock.Winsock.1
 
   oMainObject = .null.
   oMSWinsockObject = .null.
   lKonecPrejema = .f.
   cVsebina = ""
   cSporocilo = ""
   lNapaka = .f.
   lPoslano = .f.
   lConnected = .f.
 
   **************************************
   * Error event
   *
   * Error occurred
   **************************************
   Procedure DMSWinsockControlEvents_Error(Number As Integer, Description As String, Scode As Long, Source As String, HelpFile As String, HelpContext As Long, CancelDisplay As Logical) As Void
      oMainObject.Error(Number,Source,0,Description,0)
      this.lNapaka=.t.
   EndProc
…
…
ENDDEFINE
Thx for avdice,
Andrej Zeleznik
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform