Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EventHandler() problems
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
EventHandler() problems
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Miscellaneous
Thread ID:
01044248
Message ID:
01044248
Views:
55
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
Next
Reply
Map
View

Click here to load this message in the networking platform