Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timer and OLE Control working together?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00520624
Message ID:
00522609
Views:
18
This message has been marked as the solution to the initial question of the thread.
Make sure that you are on correct record when youare doing replace.

>I have Timer on my form. I also have Fax OLE Control on my form. I also have a table of requested fax records ready for faxing.
>
>The Timer has SCAN .... ENDSCAN to display requested fax records in a listbox on my form and schedule fax records for transmission and transmit them using the Fax OLE Control on my same form. I also display Fax errors and Fax messages and Fax status on my form.
>
>My question is:
>What's the best way to handle the fax shutdown/fax error handling code which is between the SCAN...ENDSCAN, just ahead of the ENDSCAN in my Timer? Everything within SCAN...ENDSCAN in my Timer works great until I do the OLE control command to actually Send the FAX which is THISFORM.FaxManJr1.SendFax. The Fax OLE control has an event called Completion Status which I do error status checking and display an error message on my form if the status is not 0 meaning an error occurred and I translate the error code into a meaningful error message.
>
>And if the fax is successful I add SENT date/time and # of attempts to the current fax record. If the fax fails, I change it to PENDING and bump # of attempts by 1 and LOOP back through the unfaxed records and try it again. I tried putting the Fax SENT/FAIL code in the Completion Status of the OLE control, but when I do that SELECT faxtable and REPLACE faxtable.status WITH "SENT" doesn't save in the fax table record for some reason.
>
>It does do a save when I put the code in the Timer for the form, but then I miss the OLE FAX control's Completion Status event result. So my other thought was to pass a PUBLIC variable to the Timer and keep the fax shutdown code in the Timer where it always was. The problem there is I need to stay in a loop until I get a Completion Status from the OLE control or I LOOP back through my Timer code before I have completed the whole faxing process being done by the OLE control's SendFax command.
>
>What would be the best way to start and stop my timer in this situation? Because I need my timer to keep on looping through SCAN ... ENDSCAN and process fax request records from the fax request table. The fax request records are created in another app that creates faxes to be sent.
>
>Thanks for the help. Not sure of best way to approach this problem. But it's all in the timing.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform