Sys(2335, 1) && disable unattended mode, allow UI WAIT WINDOW RECNO() NOWAiTThe wait window shows 0 outside the VFP Screen.
Local Parallel as Parallel Parallel = NewObject("Parallel", "ParallelFox.vcx") Parallel.StartWorkers() SCAN iFilename=ALLTRIM(Fullpath) oFilename=ALLTRIM(Newpath) Parallel.SetWorkerCount(Parallel.CPUCount) *Parallel.StartWorkers(FULLPATH('Convert.prg'),,.T.) Parallel.do("PS2PDF",'convert.prg',,iFilename,oFilename) ENDSCAN Parallel.Wait(.T.) Parallel.StopWorkers() ** Convert ps files to PDF Using ps2PDF.Dll PROCEDURE ps2PDF PARAMETERS iFilename,oFilename DECLARE INTEGER _apCreate@0 IN ps2pdf.dll AS apCreate DECLARE _apClose@4 IN ps2pdf.dll AS apClose INTEGER id DECLARE INTEGER _apConvert@4 IN ps2pdf.dll AS apConvert INTEGER id DECLARE INTEGER _apSetFunc@24 IN ps2pdf.dll AS apSetFunc INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2 DECLARE INTEGER _apGetFunc@24 IN ps2pdf.dll AS apGetFunc INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2 #define AP_Set_Output 3000 #define AP_Set_Input 3001 id=apCreate() IF (id # 0) apSetFunc(id, AP_Set_Input , 0, 0,iFilename, 0) &&input file. apSetFunc(id, AP_Set_Output, 0, 0,oFilename, 0) &&output format and file. apConvert(id) apClose(id) *Sys(2335, 1) && disable unattended mode, allow UI WAIT WINDOW RECNO() NOWAiT ENDIF ENDPROCHere is one of The sample Example given by ParallelFox which Shows How status bar is Updated in Run Time, but I could Not Comprehend it completely to incorporate in my code. Your Guidance will be appreciable.
* Progress example using thermometer form Local loMyObject Set Path To "..;examples" Additive loMyObject = CreateObject("MyObject") _Screen.AddObject("oMyHandler", "MyHandler") loMyObject.Test() Return Define Class MyHandler as Custom Procedure DisplayProgress Lparameters lnPercent, lcMessage _VFP.StatusBar = lcMessage + " (" + Transform(lnPercent) + "%)" EndProc EndDefine DEFINE CLASS MyObject AS Custom Procedure Test Local i, lnTimer, loMyObject Local Parallel as Parallel of ParallelFox.vcx Parallel = NewObject("Parallel", "ParallelFox.vcx") Parallel.StartWorkers(FullPath("ProgressEvent.prg")) Parallel.BindEvent("UpdateProgress", _Screen.oMyHandler, "DisplayProgress") lnTimer = Seconds() Parallel.CallMethod("SimulateReport", This.Class, This.ClassLibrary) EndProc Procedure SimulateReport Local lnPage Local Worker as Worker of ParallelFox.vcx Worker = NewObject("Worker", "ParallelFox.vcx") For lnPage = 1 to 100 Worker.UpdateProgress(lnPage, "Printing Report: Page " + Transform(lnPage) + " of 100") This.RunUnits(4) EndFor Worker.UpdateProgress(100, "Report Complete", .t.) EndProc Procedure SimulateWork Local i For i = 1 to 1000000 * Peg CPU EndFor EndProc Procedure RunUnits Lparameters lnUnits Local i For i = 1 to lnUnits This.SimulateWork() EndFor EndProc ENDDEFINERegards