FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Consulta funcion en C
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Consulta funcion en C
Posted: Thu Jul 21, 2011 09:19 PM
Estimados, esta es una funcion de tsbrowse6 que tengo en una aplicacion el problema es que me esta devolviendo la funcion en C un numero y deberia retornar un arreglo

por lo que acudo a ustedes a ver que puede estar pasando, de C nada c jeje

adjunto codigo

Code (fw): Select all Collapse
   aDim := aTSBrwPosRect( ::hWnd, ::nRowPos, nStartCol, nWidth, ;
                          If( ::aColumns[ nCol ]:oFont != Nil, ;
                              ::aColumns[ nCol ]:oFont:hFont, 0 ), ;
                              ::nHeightCell, ::nHeightHead, ::nHeightSuper )
    ALERT( ADIM ) //1031 esto es lo que retorna

   If ::nLineStyle < 5 .and. ! ( lDropBox .or. ;
                                 ::aColumns[ nCol ]:aList != Nil .or. ;
                                 ::aColumns[ nCol ]:cResName != Nil )

      If ! ::aColumns[ nCol ]:l3DLook
         aDim[ 3 ] -= 2
         --aDim[ 4 ]
      Else
         aDim[ 1 ] += 1 //aqui se cae
         aDim[ 2 ] += 2
         aDim[ 3 ] -= 2
         aDim[ 4 ] -= 2
      EndIf



Code (fw): Select all Collapse
#ifndef __HARBOUR__
   CLIPPER aTSBrwPosR() // ect( hWnd, nRow, nCol, nWidth, hFont, nHeightCell,
                        //      nHeightHead, nHeightSuper )
#else
   HARBOUR HB_FUN_ATSBRWPOSRECT( PARAMS )
#endif
{
   HWND hWnd        = (HWND) _parni( 1 ) ;
   int wRow         = _parni( 2 ) ;
   int wCol         = _parni( 3 ) ;
   int wWidth       = _parni( 4 ) ;
   HFONT hFont      = (HFONT) _parni( 5 ) ;
   int wHeight      = _parni( 6 ) ;
   int nHeightHead  = _parni( 7 ) ;
   int nHeightSuper = _parni( 8 ) ;

   HDC hDC = GetDC( hWnd ) ;
   HFONT hOldFont ;
   int wMaxRight ;
   RECT rct ;

   if( hFont )
      hOldFont = SelectObject( hDC, hFont ) ;

   GetWindowRect( hWnd, &rct ) ;
   wMaxRight = rct.right;

   rct.top    += ( nHeightHead + nHeightSuper ) + ( wHeight * (wRow - 1) ) + 1 ;
   rct.bottom = rct.top + wHeight ;
   rct.left   += wCol ;
   rct.right  = rct.left + wWidth ;

   if( hFont )
      SelectObject( hDC, hOldFont ) ;

   ReleaseDC( hWnd, hDC ) ;

   //_reta( 4 ) ;

   _storni( rct.top,    -1, 1 ) ;
   _storni( rct.left,   -1, 2 ) ;
   _storni( rct.bottom, -1, 3 ) ;
   _storni( ( wMaxRight <= rct.right ) ? wMaxRight - 18: rct.right, -1, 4 ) ;

}


error que genera
Error de argumento: asignaci¢n del array
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Consulta funcion en C
Posted: Thu Jul 21, 2011 09:28 PM
Hola

solo descomenta esta linea

Code (fw): Select all Collapse
_reta( 4 ) ;
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: Consulta funcion en C
Posted: Thu Jul 21, 2011 09:44 PM
Gracias daniel por responder

pero sele esto
Code (fw): Select all Collapse
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '__reta' referenced from D:\APL\PRGS\LIB32\SBROWSEH.L
IB|TSBFuncs


Code (fw): Select all Collapse
c:\borland\bcc582\bin\bcc32 -D__HARBOUR__;HB_API_MACROS;HB_FM_STATISTICS_OFF -O2 -c -I%harbour%include;%fwh%\include ..\source\function\TSBFuncs.c >>LINK.LOG


asi estoy compilando
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Consulta funcion en C
Posted: Thu Jul 21, 2011 10:06 PM
Hola

Coloca este define al principo a ver si te funciona


Code (fw): Select all Collapse
#define  _reta( n )  hb_reta( n )
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: Consulta funcion en C
Posted: Thu Jul 21, 2011 10:09 PM
Gracias daniel

buscando ejemplos de c lo encontre

Code (fw): Select all Collapse
hb_reta( 4 ) ;


ahora funciona ..... gracias

pd:

Porque el parametro 4??
Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Consulta funcion en C
Posted: Thu Jul 21, 2011 10:14 PM
Hola

el 4 es el tamaño del array que estas devolviendo

aqui llenas el array en las cuatro pociciones

Code (fw): Select all Collapse
   _storni( rct.top,    -1, 1 ) ;
   _storni( rct.left,   -1, 2 ) ;
   _storni( rct.bottom, -1, 3 ) ;
   _storni( ( wMaxRight <= rct.right ) ? wMaxRight - 18: rct.right, -1, 4 ) ;
Posts: 1074
Joined: Fri Oct 07, 2005 01:56 PM
Re: Consulta funcion en C
Posted: Thu Jul 21, 2011 10:30 PM

Gracias daniel por la info

algun dia le dare mas tiempo a ver el C, un poco complicado...

Saludos
Patricio

__________________________________________________________________
Version: Harbour 3.2.0dev (r1307082134),Compiler: Borland C++ 5.8.2 (32-bit)
PCode version: 0.3, FWH 13.2
http://www.sialm.cl

Continue the discussion