SetCurrentTask
Sets the calling thread group’s current task number
#include <nwcntask.h>
LONG SetCurrentTask (
LONG taskNumber);
This function returns the old current task number if successful. Otherwise, it returns EFAILURE.
This function sets the current task number for the thread group. If the taskNumber parameter is -1, a new task number is allocated. If the taskNumber parameter is not -1, the current task is set to that value.
Call SetCurrentTask if the NLM needs to allocate only one task number for the current connection number. If more than one task number is needed, call AllocateBlockOfTasks.