Class MaxNetCallBack
See Also: Class MaxNetManager
class MaxNetCallBack
Description:
This class is available in release 4.0 and later only.
If you want to use the call back mechanisms provided by the MaxNetManager class, you create your own class derived from MaxNetCallBack and pass it as the argument for MaxNetManager::SetCallBack(). All methods are optional. You need only to implement those you want.
Methods:
Prototype:
bool Progress(int total, int current);
Remarks:
This method is called whenever a lengthy operation is under way. This includes large block transfers, file transfers, etc.
Parameters:
int total
A total amount of information to process.
int current
From the total amount, this is the current position.
Return Value:
TRUE if you want to cancel the operation, otherwise FALSE.
Prototype:
void ProgressMsg(const TCHAR *message);
Remarks:
This method is called to provide a textual message regarding the current process which is under way (connecting to a Manager, waiting for a reply, etc.)
Parameters:
const TCHAR* message
The text message.
Prototype:
void ManagerDown();
Remarks:
This method is called for messages which are sent to indicate that the Manager was shut down and is no longer available to service any requests.
Prototype:
void Update();
Remarks:
This method is called to indicate something has changed. This message is sent whenever a new job is sent to the queue, a Server changed its state, an error occurred, etc. This allows you to be kept up to date without the need to poll the Manager from time to time. Note that these messages are queued up. That is, if 10 jobs are deleted at once or any number of changes occur within a short period, you will only receive one Update() call.
Prototype:
void QueryControl(TCHAR* station);
Remarks:
This method is called if someone requests control over the queue. If you do not have control over the queue, you do not need to respond to this message. If you have control over the queue and do nothing when this call is received, the Manager will timeout and take control over the queue. If you have control over the queue, you should respond to this message using MaxNetManager::GrantManagerControl() passing either a true value, indicating you are granting control, or a false value, indicating you do not want to relinquish control.
Parameters:
TCHAR* station
The name of the computer requesting control.
Prototype:
void QueueControl();
Remarks:
This method is called in order to notify that someone took control of the queue.