Como GetError regresa un String. Saber si ha sucedido un error es muy fácil controlar el error.
Solo hay que saber si GetError().ToString.Length > 0
He modificado el código de abajo para que use el archivo FacturaEcodex98.ini
Ese archivo no existe por lo cual la librería debe mostrar un error.
Try
GeneraCFD(Application.StartupPath & "\FacturaEcodex98.ini", "a0123456789")
If GetError().ToString.Length > 0 Then
MsgBox(GetError(), vbInformation, "Aviso")
Else
MsgBox("El XML ha sido generado", vbInformation, "Aviso")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Compilamos y obtenemos el siguiente mensaje.
Claramente indica que el archivo no existe.

DESCARGA SOFTWARE PARA FACTURA ELECTRONICA DE AQUI.
Facturacion, Validacion, Addendas, Librerias de programacion, etc.
CARTA PORTE V3.1
ECODEX TIENE ESTOS NUEVOS DATOS DE CONTACTO :
Comercializacion y Ventas - Evelia Vicke evicke@ecodex.com.mx 33-16-03-03-48
Soporte - Humberto Guerrero soporte@ecodex.com.mx 33-34-90-46-03
.
Controlando GetError() Parte 4
-
- Mensajes: 41
- Registrado: Jue Nov 25, 2010 10:23 am