Job Execution Result Notification API

This API notifies remote hosts of the execution result of a job.

Syntax

int __stdcall  hulsndrc( LPCSTR lpszJobName , LPCSTR lpszHostName , 
              LPCSTR lpszMsg , SHORT nRc , INT nRetryCnt , INT nRetryTime );

Explanation of the parameters

LPCSTR lpszJobName (IN)

Specify the name of the job for which the notification is to be sent

Specify the job name as a character string within 60 bytes. To omit this parameter, specify 'NULL.'

LPCSTR lpszHostName (IN)

Specify the remote host name

Specify the host name as a character string within 68 bytes.

LPCSTR lpszMsg (IN)

Specify the message to transmit

Specify the message as a character string within 128 bytes. To omit this parameter, specify 'NULL.'

SHORT nRc (IN)

Specify the Status code to be sent to the remote host

Specify a value from '0' to '9999.'

INT nRetryCnt (IN)

Specify the connection retry number to the remote host

Specify a value from '0' to '99999.'

INT nRetryTime (IN)

Specify the retry interval (in seconds) for the connection to the remote host

Specify a value from '0' to '99999.'

Returned Value

This function returns '0' if the processing completes successfully. The status when an error occurs is the same as the error code of 'hulsndrc.exe.'

For details, refer to Error Codes and Messages.

<Usage example>

Specifying settings when using Visual C++

#include <windows.h>
#include <stdio.h>

typedef INT (__stdcall *LPHULSNDRC)( 
LPCSTR lpszJobName, LPCSTR lpszHostName, 
LPCSTR lpszMsg, SHORT nRc, INT nRetryCnt, 
INT nRetryTime); 

int main() 
{ 
    CHAR szJobName[60+1]; 
    CHAR szHostName[68+1]; 
    CHAR szMsg[128+1]; 
    SHORT nRC; 
    INT nRetryCnt; 
    INT nRetryTime; 
    HMODULE hHulDll; 
    HMODULE hApiDll; 
    LPHULSNDRC lpHulsndrc; 
    INT nStatus; 

    strcpy_s(szJobName, sizeof(szJobName), "Job_0001"); 
    strcpy_s(szHostName, sizeof(szHostName), "host0001"); 
    strcpy_s(szMsg, sizeof(szMsg), "Message"); 
    nRC = 0; 
    nRetryCnt = 10; 
    nRetryTime = 1; 

    hHulDll = LoadLibrary("C:\\HULFT Family\\hulft8\\bin\\hulftrt.dll"); 
    if (hHulDll == NULL) 
    { 
        printf("Unable to load hulftrt.dll." 
        "(Error code=%lu)\n", GetLastError()); 
        return 1; 
    } 
    hApiDll = LoadLibrary("C:\\HULFT Family\\hulft8\\bin\\hulapi.dll"); 
    if (hApiDll == NULL) 
    { 
        printf("Unable to load hulapi.dll." 
        "(Error code=%lu)\n", GetLastError()); 
        FreeLibrary(hHulDll); 
        return 2; 
    } 
    lpHulsndrc = (LPHULSNDRC)GetProcAddress(hApiDll, "hulsndrc"); 
    if (lpHulsndrc == NULL) 
    { 
        printf("Unable to retrieves the address of HULFT API." 
        "(Error code=%lu)\n", GetLastError()); 
        FreeLibrary(hApiDll); 
        FreeLibrary(hHulDll); 
        return 3; 
    } 
    nStatus = lpHulsndrc(szJobName, szHostName, szMsg, nRC, nRetryCnt, nRetryTime); 
    if (nStatus == 0) 
    { 
        printf("Terminated normally.\n"); 
    } 
    else 
    { 
        printf("Error occurred when calling HULFT API." 
        "(Returned value=%d)\n", nStatus); 
    } 
    FreeLibrary(hApiDll); 
    FreeLibrary(hHulDll); 
    return 0; 
}