Ken,
Just a couple of things...
The timer won't really be a separate thread your COM instance only has one thread. The timer will allow your call to return and then have the really called code execute sometime in the future. You can accomplish the same thing by doing a ShellExecute() since you aren't waiting for the spawned process to finish.
asjr = 0
I'd write the above line as
asjr = .null.
because it doesn't set the property to a numeric and then change it to an object reference later.
In your timer.Timer event you might want to tweak the code if these things you are calling take longer than the timer interval to execute:
PROCEDURE timer
if this.CJobid != ""
private Job
private Inputfile
private CPRG
Job = this.CJobid
Inputfile = this.CFile
this.Enabled = .f.
do (this.CPRG)
set exact on
set ansi on
set date to BRITISH
this.CJobid = ""
this.CFile = ""
this.CPRG = ""
this.Enabled = .t.
endif
ENDPROC
>and confimation that you don't think I'm doing anything terrible here.
>
>I've put together my code for running a bunch of old prg's that run jobs, I have a program that creates 3 EXE COM objects bassed on session (single use so they are all running separately) the class for these objects creates a timer in the init (so the timer gets it's own thread). From the main program I can then send job requests, the COM class fills in info in the timer class, the timer kicks in and runs the prg and everything stays responsive. I use the timer so that there is no chain of waiting for a function to return.
>
>it all seems to work perfectly, I guess I just wanted to check you you all knowing types that I'm not going the wrong way about this.