Thats the thing about programming in Symbian, everyone thinks they need threads but they don't....
Code:
RThread thread;
thread.Create(KFTPServiceName, (TThreadFunction)threadFunction,MAX_STACK_SIZE,NULL,this);
thread.Logon(iStatus);
thread.SetPriority(EPriorityNormal);
thread.Resume();
thread.Close();
.... the thread object is now dead and the iStatus is cancelled
.... set active will have no effect
SetActive();
On another note, you probably can't share FTP services like this as each thread needs its own cleanup stack, trap harness and active scheduler.
Objects cannot really be passed between threads.
Active objects are specific to a thread, so the iStatus is actually referring to an object in the wrong thread context which is another error.
If you need to share active objects between threads, you need to setup a trap harness, cleanup stack and active object for each thread (including the process thread), do not share classes that use handles, remember to block concurrent access to shared state.
To complete cross thread calls, you need to pass the thread handle id to the other thread. Open an RThread local object using the handle and then complete the iStatus on that thread object (see RThread::RequestComplete)
This will then signal the active scheduler in the other thread to tell it that a request has been signalled and look for the active object that has completed in the list of active objects.