Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing event parameters in a prg
Message
From
05/04/2009 11:57:56
 
 
To
05/04/2009 00:27:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01393307
Message ID:
01393332
Views:
50
>I am integrating FTP software from WeOnlyDo - wodFtpDLX - into a FoxPro prg as a COM object. A user is having a problem with duplicate messages in his mailbox so I want to add the FTPReply Event to trace the commands sent back and forth.
>
>I do not have a form, so I have to do this in code and I'm not sure how to get the values of the Event parameters into my prg.
>
>I create the object like this:
> loFtp = CREATEOBJECT('WeOnlyDo.wodFtpDLXCom.1')
>
>Then I want to say something like the following.
>
> loFtp.GetFile(lcPathFile)
>
> * 090404 smr: Call FTPReply Event to debug.
> ReplyCode = 0
> ReplyText = ""
> loFtp.FTPReply("GetFile", ReplyCode, ReplyText)
>
> DisplayError(-1, "FTPReply after 'GetFile': "+ReplyCode+" / "+ReplyText)
> * 090404 End of FTPReply debug code.
>
>But I don't think that this code returns the value of ReplyCode and ReplyText. How do I send these values back to my prg from the WeOnlyDo FTPReply event so that I can write them to a file and see what FTP events are really happening in the user's mailbox?
>
>The WOD description of FTPReply is the following:
>
>Description: Fires when wodFtpDLX provides information about executed command and returned reply.
>
>Syntax: Private Sub object_FTPReply(Command, ReplyCode, ReplyText)
>
> The FTPReply Event syntax has these parts:
> Part Description
> object A wodFtpDLX object.
> Command A String value. Command executed by wodFtpDLX.
> ReplyCode An Integer value. Holds reply code returned by the server.
> ReplyText A String value. Full reply as returned by the server.
>
>Remarks: FTPReply event is just debug event that will be fired only with FTP-alike transfer protocols (FTP and FTPS). Each time some command is executed by wodFtpDLX, this event will be fired. It will contain executed command, and reply code (and full text) as returned by the server.
> If server's reply contains more than one line, they will all be included in ReplyText. If same code produces more than one reply (with different codes), FTPReply will fire more than once. Each time Command argument will contain command that caused this reply to be returned. Typical example is 'RETR' command which causes server to send '150 Data connection open' and '226 Transfer finished'.
>
>Thanks for helping.
>Susan

I may be wrong, but it looks similar to something I am doing now. The event needs to be visible via com interop. Is the dll registered for COM on the machine using regasm? In the VFP object browser, is the event visible with a yellow lightening bolt beside it? If so, you need to hook into the event by creating an event interface which will fire automatically and you can handle the event from there.

Look at some of Rick's examples:

http://www.west-wind.com/presentations/dotnetfromVfp/DotNetFromVfp_EventHandling.asp
http://www.west-wind.com/WebLog/posts/3972.aspx
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform