FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Compilar c贸digo 'C'.
Posts: 1445
Joined: Mon Oct 10, 2005 02:38 PM
Compilar c贸digo 'C'.
Posted: Tue Feb 17, 2009 10:32 PM
A ver si algui茅n puede compilar este c贸digo.

Yo ya no se que mirar (el problema es que no se 'C').
El problema lo tengo con: 'BYTE InputType', al compilador no le gusta como le asigno el valor a 'InputType'.

Un Saludo y gracias.
Carlos G.

Este es el c贸digo:

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

struct arg_list {
聽 聽 long 聽 InitLine; 聽 聽 聽 聽 聽// Line number to position at the beginning.
聽 聽 BYTE 聽 InputType; 聽 聽 聽 聽 /* This flag specifies the input type. If you wish to
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽edit a file, set the input_type to 'F'. Conversely,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽if you wish to pass the text for editing in a buffer,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽set this field to 'B'. */
聽 聽 BYTE 聽 file[131]; 聽 聽 聽 聽/* 聽If the input type is set to 'F', 聽specify the file
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽name for editing in this field. */
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽// ===== Buffer input fields only =======
聽 聽 };

HWND CreateTerWindow( HWND );

HB_FUNC( PRGCreateTerWindow )
{

聽 聽HWND hWndTer;

聽 聽struct arg_list aParams;

聽 聽aParams.InitLine 聽 聽 聽= hb_parnl(1,19);
聽 聽aParams.InputType 聽 聽 = hb_parc(1,20);
聽 聽strcpy( aParams.file, hb_parc( 1, 21 ) );

聽 聽hWndTer = CreateTerWindow( &aParams );

聽 聽hb_reta( 2 ); // creamos y devolvemos un array de 2 elementos.

聽 聽// rellenamos los datos del array (situado en "return", que se indica con -1)
聽 聽hb_stornl( ( LONG ) hWndTer, -1, 1 );
聽 聽hb_stornl( ( LONG ) aParams.InitLine, -1, 2 );

}

#pragma ENDDUMP

Un Saludo

Carlos G.



FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Compilar c贸digo 'C'.
Posted: Tue Feb 17, 2009 11:01 PM
Carlos,

Asi compila bien. Compara los cambios que he hecho:
Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

struct arg_list {
聽 聽 long 聽 InitLine; 聽 聽 聽 聽 聽// Line number to position at the beginning.
聽 聽 BYTE 聽 InputType; 聽 聽 聽 聽 /* This flag specifies the input type. If you wish to
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽edit a file, set the input_type to 'F'. Conversely,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽if you wish to pass the text for editing in a buffer,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽set this field to 'B'. */
聽 聽 BYTE 聽 file[131]; 聽 聽 聽 聽/* 聽If the input type is set to 'F', 聽specify the file
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽name for editing in this field. */
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽// ===== Buffer input fields only =======
聽 聽 };

HWND CreateTerWindow( struct arg_list * );

HB_FUNC( PRGCreateTerWindow )
{

聽 聽HWND hWndTer;

聽 聽struct arg_list aParams;

聽 聽aParams.InitLine 聽 聽 聽= hb_parnl(1,19);
聽 聽aParams.InputType 聽 聽 = hb_parc(1,20)[ 0 ];
聽 聽strcpy( aParams.file, hb_parc( 1, 21 ) );

聽 聽hWndTer = CreateTerWindow( &aParams );

聽 聽hb_reta( 2 ); // creamos y devolvemos un array de 2 elementos.

聽 聽// rellenamos los datos del array (situado en "return", que se indica con -1)
聽 聽hb_stornl( ( LONG ) hWndTer, -1, 1 );
聽 聽hb_stornl( ( LONG ) aParams.InitLine, -1, 2 );

}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1445
Joined: Mon Oct 10, 2005 02:38 PM
Re: Compilar c贸digo 'C'.
Posted: Wed Feb 18, 2009 12:14 PM
Much铆simas gracias Antonio,

Esta tarde lo pruebo.

Un saludo
Carlos G.


Antonio Linares wrote:Carlos,

Asi compila bien. Compara los cambios que he hecho:
Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

struct arg_list {
聽 聽 long 聽 InitLine; 聽 聽 聽 聽 聽// Line number to position at the beginning.
聽 聽 BYTE 聽 InputType; 聽 聽 聽 聽 /* This flag specifies the input type. If you wish to
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽edit a file, set the input_type to 'F'. Conversely,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽if you wish to pass the text for editing in a buffer,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽set this field to 'B'. */
聽 聽 BYTE 聽 file[131]; 聽 聽 聽 聽/* 聽If the input type is set to 'F', 聽specify the file
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽name for editing in this field. */
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽// ===== Buffer input fields only =======
聽 聽 };

HWND CreateTerWindow( struct arg_list * );

HB_FUNC( PRGCreateTerWindow )
{

聽 聽HWND hWndTer;

聽 聽struct arg_list aParams;

聽 聽aParams.InitLine 聽 聽 聽= hb_parnl(1,19);
聽 聽aParams.InputType 聽 聽 = hb_parc(1,20)[ 0 ];
聽 聽strcpy( aParams.file, hb_parc( 1, 21 ) );

聽 聽hWndTer = CreateTerWindow( &aParams );

聽 聽hb_reta( 2 ); // creamos y devolvemos un array de 2 elementos.

聽 聽// rellenamos los datos del array (situado en "return", que se indica con -1)
聽 聽hb_stornl( ( LONG ) hWndTer, -1, 1 );
聽 聽hb_stornl( ( LONG ) aParams.InitLine, -1, 2 );

}

#pragma ENDDUMP

Un Saludo

Carlos G.



FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home

Continue the discussion