A ver si alguien me puede hechar una mano en el c贸digo que dejo al final.
Estoy intentando definir una llamada a una funci贸n que est谩 en una DLL externa (ter16.dll [no es de 16b a pesar de su nombre]).
Es una funci贸n que recibe un puntero a una estructura, esta estructura la rellenar茅 con los valores de una array. La funci贸n de la DLL devuelve un handle de una ventana.
Yo adem谩s intento que la funci贸n que estoy definiendo para lanzar la de C devuelva en un array de 2 elementos, el handle que ha devuelto la funci贸n en C y otro handle.
No se si me he explicado bien.
Independientemente de si lo he programado bien, el caso est谩 en primero conseguir que se compile la definici贸n (lo estoy intentando con la versi贸n de Harbour de la de FiveWin 9.01).
Puede algui茅n intentar compilar este c贸digo y a ver si me orienta en lo que debo modificar para que compile correctamente?
Por cierto no ser铆a mala idea recopilar los mensajes en donde se trata el tema de definiciones de funciones en C, he le铆do un mont贸n de mensajes en estos foros pero me ha costado 'aislarlos' dle resto.
Un saludo y gracias.
Carlos G.
/* ************************************** */
#pragma BEGINDUMP
#include <hbapi.h>
#include <windows.h>
struct arg_list {
聽 聽 int 聽 聽x; 聽 聽 聽 聽 /* Initial x position of the editing window,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽you may specify CW_USEDEFAULT to use default values.*/
聽 聽 int 聽 聽y; 聽 聽 聽 聽 // Initial y position of the editing window.
聽 聽 int 聽 聽width; 聽 聽 /* Initial width of the window in device units,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽you may specify CW_USEDEFAULT to use default values.*/
聽 聽 int 聽 聽height; 聽 聽/* Initial height of the editing window. 聽When you
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽use CW_USEDEFAULT for 'width', the 'height' is
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽ingnored.*/
聽 聽 long 聽 LineLimit; /* Number of lines allowed in the editor window.
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽Set to 0 to have unlimited number of lines*/
聽 聽 BOOL 聽 WordWrap; 聽/* Set this flag to true (1), 聽if you wish to enable the
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽word wrapping feature. */
聽 聽 BOOL 聽 PrintView; /* Set this flag to true if you wish the lines on
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽the screen to be wrapped current page margins.
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽Otherwise, the lines are wrapped at the end of
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽the window. This variable is ignored if 'WordWrap'
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽is set to FALSE */
聽 聽 BOOL 聽 PageMode; 聽/* Set this flag to true if you wish to edit one page
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽at a time */
聽 聽 BOOL 聽 FittedView;// Set this flag to enable special PageMode where the
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // text wraps within the window width
聽 聽 BOOL 聽 ShowStatus;// show status line ?
聽 聽 BOOL 聽 ShowMenu; 聽// show the menu bar ?
聽 聽 BOOL 聽 ShowHorBar;// show the horizonatal scroll bar
聽 聽 BOOL 聽 ShowVerBar;// show the vertical scroll bar
聽 聽 BOOL 聽 ruler; 聽 聽 // True to show the ruler
聽 聽 BOOL 聽 ToolBar; 聽 // True to show the tool bar
聽 聽 BOOL 聽 UserCanClose;// TRUE allows the user to close the window
聽 聽 BOOL 聽 BorderMargins;// display margins around the window borders
聽 聽 BOOL 聽 ReadOnly; 聽 聽// TRUE to create a read only session
聽 聽 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 =======
聽 聽 HGLOBAL hBuffer; /* 聽Specify the global memory handle containing the
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽input text data. 聽This handle becomes the property
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽of the editor. 聽Your program must never try to lock
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽or free this handle */
聽 聽 long BufferLen; 聽// 聽Buffer length in number of characters.
聽 聽 BYTE delim; 聽 聽 聽/* 聽Line delimiter character. 聽This character must be
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽used to delimit individual lines within the
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽text buffer. 聽This character is normally typically set
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽to 13 (carriage return) */
聽 聽 BYTE 聽 padding1[3]; // This field is not used
聽 聽 int 聽 聽SaveFormat;// The format of the output file: SAVE_TER, SAVE_TEXT,
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // SAVE_RTF and SAVE_AS_INPUT
聽 聽 HINSTANCE hInst; 聽// 聽Handle of the current instanaces.
聽 聽 HWND 聽 hParentWnd;// Handle to the parent window
聽 聽 HWND 聽 hTextWnd; // 聽Ter main window handle, will be filled by TER later
聽 聽 DWORD 聽style; 聽 聽// 聽Editor window style
聽 聽 BYTE 聽 FontTypeFace[28]; // Default type face, example: TmwRmn Courier, etc
聽 聽 int 聽 聽PointSize;// point size of the default font face
聽 聽 BOOL 聽 聽 聽 open; 聽 聽 // TRUE indicates an open window
聽 聽 int 聽 聽 聽 聽modified; // For internal use
聽 聽 BOOL 聽 聽 聽 vruler; 聽 // sbow vertical ruler
聽 聽 };
HB_FUNC( PRGCreateTerWindow )
{
聽 聽struct arg_list aParams;
聽 聽aParams.x 聽 聽 聽 聽 聽 聽 = hb_parnl(1,1);
聽 聽aParams.y 聽 聽 聽 聽 聽 聽 = hb_parnl(1,2);
聽 聽aParams.width 聽 聽 聽 聽 = hb_parnl(1,3);
聽 聽aParams.height 聽 聽 聽 聽= hb_parnl(1,4);
聽 聽aParams.LineLimit 聽 聽 = hb_parnl(1,5);
聽 聽aParams.WordWrap 聽 聽 聽= hb_parnl(1,6);
聽 聽aParams.PrintView 聽 聽 = hb_parnl(1,7);
聽 聽aParams.PageMode 聽 聽 聽= hb_parnl(1,8);
聽 聽aParams.FittedView 聽 聽= hb_parnl(1,9);
聽 聽aParams.ShowStatus 聽 聽= hb_parnl(1,10);
聽 聽aParams.ShowMenu 聽 聽 聽= hb_parnl(1,11);
聽 聽aParams.ShowHorBar 聽 聽= hb_parnl(1,12);
聽 聽aParams.ShowVerBar 聽 聽= hb_parnl(1,13);
聽 聽aParams.ruler 聽 聽 聽 聽 = hb_parnl(1,14);
聽 聽aParams.ToolBar 聽 聽 聽 = hb_parnl(1,15);
聽 聽aParams.UserCanClose 聽= hb_parnl(1,16);
聽 聽aParams.BorderMargins = hb_parnl(1,17);
聽 聽aParams.ReadOnly 聽 聽 聽= hb_parnl(1,18);
聽 聽aParams.InitLine 聽 聽 聽= hb_parnl(1,19);
聽 聽aParams.InputType 聽 聽 = hb_parnl(1,20);
聽 聽aParams.file 聽 聽 聽 聽 聽= hb_parnl(1,21);
聽 聽aParams.hBuffer 聽 聽 聽 = hb_parnl(1,22);
聽 聽aParams.BufferLen 聽 聽 = hb_parnl(1,23);
聽 聽aParams.Delim 聽 聽 聽 聽 = hb_parnl(1,24);
聽 聽aParams.SaveFormat 聽 聽= hb_parnl(1,25);
聽 聽aParams.hInst 聽 聽 聽 聽 = hb_parnl(1,26);
聽 聽aParams.hParentWnd 聽 聽= hb_parnl(1,27);
聽 聽aParams.hTextWnd 聽 聽 聽= hb_parnl(1,28);
聽 聽aParams.style 聽 聽 聽 聽 = hb_parnl(1,29);
聽 聽aParams.FontTypeFace 聽= hb_parnl(1,30);
聽 聽aParams.PointSize 聽 聽 = hb_parnl(1,31);
聽 聽aParams.Open 聽 聽 聽 聽 聽= hb_parnl(1,32);
聽 聽aParams.Modified 聽 聽 聽= hb_parnl(1,33);
聽 聽hb_retnl ( 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( aParams.hParentWnd, -1, 1 );
聽 聽hb_stornl( aParams.hTextWnd, -1, 2 );
}
#pragma ENDDUMP
/* ************************************** */Un Saludo
Carlos G.
FiveWin 25.12 + Harbour 3.2.0dev (r2502110321), BCC 7.7 Windows 11 Home