Description
The routine CPXdelfuncdest() removes the function msgfunction() from the list of message destinations associated with a channel. Use CPXdelfuncdest() to remove functions that were added to the list using CPXaddfuncdest().CPXaddfuncdest() to add the address of a function to the list of message destinations associated with the cpxerror channel. Then write the msgfunction() routine. It must contain the code that controls the dialog box. When CPXmsg() is called with cpxerror as its first argument, it will call the msgfunction() routine, which can then display the error message.
|
|
The handle parameter is a generic pointer that can be used to hold information needed by the msgfunction() routine to avoid making such information global to all routines.
|
msgfunction() is not in the message destination list or the channel does not exist.
int CPXdelfuncdest (CPXENVptr env,
CPXCHANNELptr channel,
void *handle,
void (CPXPUBLIC *msgfunction) (void*, char*));
CPXENVptr envThe pointer to the CPLEX environment as returned by one of the
CPXopenCPLEX routines.
CPXCHANNELptr channelThe pointer to the channel to which the function destination is to be added.
void *handleA void pointer that can be used in the
msgfunction() routine to direct the message to a file, the screen, or a memory location.
void (CPXPUBLIC *msgfunction) (void*, char*)The pointer to the function to be called when a message is sent to a channel. For details about this callback function, please see
CPXaddfuncdest().
void msgfunction (void *handle, char *msg_string)
{
FILE *fp;
fp = (FILE *)handle;
fprintf (fp, "%s", msg_string);
}
status = CPXdelfuncdest (env, mychannel, fileptr, msgfunction);