Function
The function Command is used for sending a text command to a specified D2000 system client process, or to the D2000 Server process. List of text commands is still increasing in consequence of development. The current list can be acquired by means of the process D2000 Application Manager
Declaration

APIRET Command(const char *cmd, HOBJ procesId, const char *procesName, int bTransAct);

Parameters
The parameter cmd represents the text command to send to a process. procesId is the unique identifier of the process in the system. If it is 0, there will be used the parameter procesName that must contain the client process name.
If procesId=0 and procesName is NULL or empty string, the text command will be sent to the D2000 Server process.
The parameter bTransAct determines calling the function - synchronous (bTransAct /= 0) or asynchronous (bTransAct = 0). For asynchronous command execution, the command is sent to the system as a request and the function doesn't wait for its completion. For synchronous command execution, the function waits for its completion. This allows to test its successful (or unsuccessful) execution. 
Return code
CodeDescription
API_OKObject opened correctly.
API_TimeoutErrorFor synchronous execution, maximum time was exceeded.
API_TR_AbortFor synchronous execution, command execution was not successful.
API_TR_ErrorFor synchronous execution, command execution was not successful.
API_TR_IgnoredFor synchronous execution, command execution was not successful.
API_ParamErrorIncorrect parameters.
Napíšte komentár