*--Create the worker objects for sending threaded mail. This.m_oWorker1=CREATEOBJECT('VFPMTAPP.Worker.1') This.m_oWorker2=CREATEOBJECT('VFPMTAPP.Worker.1') *--The worker threads will call ThisForm.OnMailSent when the work is done This.m_oWorker1.SinkNotified(This,"OnMailSent") This.m_oWorker2.SinkNotified(This,"OnMailSent")Part of the form's send mail button click()
IF ! ThisForm.m_oWorker1.Running *--NOTE: this thread calls a Multi-threaded DLL created in fox. *--Send the parameters via array. =ThisForm.m_oWorker1.Run("SendSocketMail.SendSocketMail","SendMail",@laMailParms) ELSE *--Try using the 2nd thread. IF ! ThisForm.m_oWorker2.Running =ThisForm.m_oWorker2.Run("SendSocketMail.SendSocketMail","SendMail",@laMailParms) ELSE =WriteToLog("*ERR* All worker threads were already running. Could not send mail.", .T.) ENDIF ENDIF