The function SSubmitJobMsg submits a job to ITP/Server using TCP/IP sockets as the communication mechanism. The job submission process is handled in a separate thread. After the job has been processed a message is sent to the controlling window.
BOOL WINAPI SSubmitJobMsg (
TCHAR *Host, // pointer to host
TCHAR *Port, // pointer to port
TCHAR *JobID, // pointer to Job Identifier
TCHAR **Parameters, // parameter list, starting with
// the name of the requested Service
TCHAR *Result, // buffer for result text
int Length, // size of buffer
HANDLE hWindow // handle of the controlling window
);
Pointer to a null-terminated string that contains the name of the server running ITP/Server. The name can be specified either in (IPv4) Internet Protocol dotted address notation (a.b.c.d) or as a resolvable host name.
Pointer to a null-terminated string that contains the name of the port to connect to. The port can be specified either in numerical format or as a service name that is resolved through any available service databases.
Pointer to a null-terminated string that contains the Job Identifier for the job.
Pointer to a null-terminated list of string pointers. Every string pointer in this list points to a parameter that is passed with the request to ITP/Server. The first parameter should be the name of the requested Service. For all parameters, the meaning of the empty string ("") is that the parameter is not passed at all, and ITP/Server will substitute the default value (or generate an error if no default value has been specified).
If Parameters is NULL no parameters are passed with the job.
Pointer to a buffer that receives an error message if the submission of the job or the processing of the job failed.
Size of the buffer indicated by Result in characters.
Handle of the controlling window. SSubmitJobMsg will send this window a message after the job has been processed.
The SSubmitJobMsg function creates a thread to wait for the synchronous processing of the request. The SSubmitJobMsg will return TRUE return if this thread has been created successfully, and FALSE if the creation of the thread failed.
If SSubmitJobMsg returns FALSE, the buffer indicated by Result contains an error message explaining why the thread could not be started.
The SSubmitJobMsg function will send an ITPDS_RESULT message to the hWindow window after the request has been processed. The wParam parameter of this message will be TRUE if the request succeeded, and FALSE otherwise. If the request failed, the lParam parameter will point to a NUL-terminated string indicating the cause of the failure.
Use the RegisterWindowMessage function from the Microsoft Windows API to retrieve the identifier for the ITPDS_RESULT message.
The parameter Length contains the size of the Result buffer in characters, not bytes.
The error message that is placed in the Result buffer on failure will be truncated if the buffer is too small. A size of at least 1024 characters is advised.
The parameters passed to the function SSubmitJobMsg should not be freed until the reply message has been received.
The SSubmitJobMsg will send the name of the user logged on at the workstation as the User of the job.
Header: Declared in s_api.h.
Import Library: Use sock_api.lib.
Unicode: Implemented as both Unicode and ASCII.