Consulta errores en archivo build (warning)
Posted: Wed Aug 31, 2022 2:44 pm
Hola amigos :
me aparecen errores en el archivo build despues de crear el ejecutable desde el IDE .
Estos errores son todos similares y en el mismo segmento de programa , el error es el siguiente
Hello friends :
I get errors in the build file after creating the executable from the IDE.
These errors are all similar and in the same program segment, the error is as follows
F:\Disco\hmgdemo\Gestion\TFWIN\NG\9.07\Rs232.Prg: In function 'HB_FUN_OPENCOM':
F:\Disco\hmgdemo\Gestion\TFWIN\NG\9.07\Rs232.Prg:213:11: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
printf("Error %d\n",dwError);
^
F:\Disco\hmgdemo\Gestion\TFWIN\NG\9.07\Rs232.Prg:216:11: warning: passing argument 1 of 'hb_retnl' makes integer from pointer without a cast [-Wint-conversion]
hb_retnl( handle );
El segmento de programa es el siguiente :
The program segment is as follows:
#pragma BEGINDUMP
#define BUFF_IN 1024
#define BUFF_OUT 1024
#define GENERIC_READ 0x80000000
#define GENERIC_WRITE 0x40000000
#define OPEN_EXISTING 3
#define INVALID_HANDLE_VALUE -1
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#define NOPARITY 0
#define ODDPARITY 1
#define EVENPARITY 2
#define MARKPARITY 3
#define SPACEPARITY 4
#define ONESTOPBIT 0
#define ONE5STOPBITS 1
#define TWOSTOPBITS 2
#include <windows.h>
#include <winbase.h>
#include <hbapi.h>
HB_FUNC( OPENCOM )
{
HANDLE handle ;
DWORD dwError;
//handle = CreateFile(hb_parc( 1 ),( GENERIC_READ | GENERIC_WRITE ), 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
handle = CreateFile(hb_parc( 1 ),( GENERIC_READ | GENERIC_WRITE ), 0, NULL, OPEN_EXISTING, 0, NULL);
if(handle == INVALID_HANDLE_VALUE)
{
dwError = GetLastError(); *** Estas lineas se hace referencia
printf("Error Createfile \n");
printf("Error %d\n",dwError);
}
hb_retnl( handle );
}
Alguien sabe como podre solucionarlo
Saludos cordiales
Mario Rafael Mansilla
Does anyone know how I can solve it
Best regards
Mario Rafael Mansilla
me aparecen errores en el archivo build despues de crear el ejecutable desde el IDE .
Estos errores son todos similares y en el mismo segmento de programa , el error es el siguiente
Hello friends :
I get errors in the build file after creating the executable from the IDE.
These errors are all similar and in the same program segment, the error is as follows
F:\Disco\hmgdemo\Gestion\TFWIN\NG\9.07\Rs232.Prg: In function 'HB_FUN_OPENCOM':
F:\Disco\hmgdemo\Gestion\TFWIN\NG\9.07\Rs232.Prg:213:11: warning: format '%d' expects argument of type 'int', but argument 2 has type 'DWORD {aka long unsigned int}' [-Wformat=]
printf("Error %d\n",dwError);
^
F:\Disco\hmgdemo\Gestion\TFWIN\NG\9.07\Rs232.Prg:216:11: warning: passing argument 1 of 'hb_retnl' makes integer from pointer without a cast [-Wint-conversion]
hb_retnl( handle );
El segmento de programa es el siguiente :
The program segment is as follows:
#pragma BEGINDUMP
#define BUFF_IN 1024
#define BUFF_OUT 1024
#define GENERIC_READ 0x80000000
#define GENERIC_WRITE 0x40000000
#define OPEN_EXISTING 3
#define INVALID_HANDLE_VALUE -1
#define FILE_ATTRIBUTE_NORMAL 0x00000080
#define NOPARITY 0
#define ODDPARITY 1
#define EVENPARITY 2
#define MARKPARITY 3
#define SPACEPARITY 4
#define ONESTOPBIT 0
#define ONE5STOPBITS 1
#define TWOSTOPBITS 2
#include <windows.h>
#include <winbase.h>
#include <hbapi.h>
HB_FUNC( OPENCOM )
{
HANDLE handle ;
DWORD dwError;
//handle = CreateFile(hb_parc( 1 ),( GENERIC_READ | GENERIC_WRITE ), 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
handle = CreateFile(hb_parc( 1 ),( GENERIC_READ | GENERIC_WRITE ), 0, NULL, OPEN_EXISTING, 0, NULL);
if(handle == INVALID_HANDLE_VALUE)
{
dwError = GetLastError(); *** Estas lineas se hace referencia
printf("Error Createfile \n");
printf("Error %d\n",dwError);
}
hb_retnl( handle );
}
Alguien sabe como podre solucionarlo
Saludos cordiales
Mario Rafael Mansilla
Does anyone know how I can solve it
Best regards
Mario Rafael Mansilla