MIDRANGE dot COM Mailing List Archive



Home » C400-L » September 2003

error handling on API call



fixed

I want to call API QUSROBJD to check if an object
exists or not. The API call is working but it sends an
escape message terminating the program when an error
occurs (file not found, etc.). How do i prevent this ?
I want to use the info provided in the error area to
check for the exception ID, but the program blows
everytime the object is not found. When i call this
API from an RPG program the program flow continues
when an error occurs, how do i simulate this behavior
?

Thanks in advance.

Carlos Kozuszko.


#include <stdlib.h>
#include <qsnddtaq.h>
#include <QUSROBJD.h>
#include <qtes.h>

typedef struct {
    int Bytes_Returned;
    int Bytes_Available;
    char Exception_ID[7];
    char Reserved;
    char Exception_Data[240];
} ERRC0100_t;

void main() {
    _TE_NAME_T objType;
    _TE_OBJLIB_T dtaq;
    Qus_OBJD0100_t objInfo;
    ERRC0100_t errInfo;
    
    /* Verificar si existen las colas */
    memcpy(dtaq.lib, "QTEMP     ", 
           sizeof(_TE_NAME_T));
    memcpy(dtaq.obj, "OUT_ABGQ  ", 
           sizeof(_TE_NAME_T));
    memcpy(objType, "*DTAQ     ", 
           sizeof(_TE_NAME_T));
    QUSROBJD(&objInfo, sizeof(objInfo), 
             "OBJD0100", &dtaq, 
             objType, &errInfo);
}


------------
Internet GRATIS es Yahoo! Conexión
4004-1010 desde Buenos Aires. Usuario: yahoo; contraseña: yahoo
Más ciudades: http://conexion.yahoo.com.ar





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact