Intentando compilar con FWH 10.9

Intentando compilar con FWH 10.9

Postby José Vicente Beltrán » Sun Oct 17, 2010 3:31 pm

Hola a todos
acabo de actualizar mi antigua version de FWH28 a la ultima FWH10.9

El caso es que intento compilar con la nueva versión un viejo programa que lleva funcionando toda la vida con la FWH28 y me arroja el error

Error: Unresolved external 'AlphaBlend' referenced from D:\FIVEWIN\FWH109\LIB\FIVEHC.LIB|BRUSHES
aquí no se que puede faltarme :oops:

Error: Unresolved external 'std::_String_base::_Xran() const' referenced from D:\FIVEWIN\XHARBOUR121\LIB\HBZIP.LIB|zipstorage
Error: Unresolved external 'std::_String_base::_Xlen() const' referenced from D:\FIVEWIN\XHARBOUR121\LIB\HBZIP.LIB|zipstorage
Error: Unresolved external 'std::locale::id::_Id_cnt' referenced from D:\FIVEWIN\XHARBOUR121\LIB\HBZIP.LIB|zipstring
Error: Unresolved external 'std::locale::_Getfacet(unsigned int) const' referenced from D:\FIVEWIN\XHARBOUR121\LIB\HBZIP.LIB|zipstring
Error: Unresolved external 'std::_Locinfo::~_Locinfo()' referenced from D:\FIVEWIN\XHARBOUR121\LIB\HBZIP.LIB|zipstring
Error: Unresolved external 'std::_Locinfo::_Locinfo(const char *)' referenced from D:\FIVEWIN\XHARBOUR121\LIB\HBZIP.LIB|zipstring
Error: Unresolved external '__Getctyptab' referenced from D:\FIVEWIN\XHARBOUR121\LIB\HBZIP.LIB|zipstring
Error: Unresolved external 'std::locale::facet::_Register()' referenced from D:\FIVEWIN\XHARBOUR121\LIB\HBZIP.LIB|zipstring
Aquí ya enlacé zlib, hbzip :oops:

Por si tuviera importancia, el compilador sigue siendo el Borland 5.5 de siempre. :?
Entiendo que me falta por enlazar alguna libreria o algo que configurar. Si alguien puede ayudarme gracias por anticipado. :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: Intentando compilar con FWH 10.9

Postby Daniel Garcia-Gil » Sun Oct 17, 2010 4:15 pm

Jose

debes usar borland 5.582
http://www.fivetechsoft.com/files/software/bcc582.zip

te falta enlazar la libreria de borlan lib\psdk\msimg32.lib

para mas detalle puedes ver los script de construccion de ejemplos en la carpeta samples (buildh.bat, builldx.bat, etc) para ver las librerias necesarias
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Intentando compilar con FWH 10.9

Postby José Vicente Beltrán » Sun Oct 17, 2010 4:25 pm

Gracias Daniel, pensé que se podia seguir con la antigua versión B5.5

Investigo.. :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: Intentando compilar con FWH 10.9

Postby José Vicente Beltrán » Sun Oct 17, 2010 10:14 pm

Ya tengo todo reconfigurado pero me queda un ultimo paso.
¿Que me falta? :oops:

Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '_hb_stack' referenced from D:\TRABAJO32\COMUN\MENU\XMENU109.LIB|GRADFILL

FWH 10.9 + xHarbour 1.21 + BCC 5.82 :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: Intentando compilar con FWH 10.9

Postby Daniel Garcia-Gil » Sun Oct 17, 2010 10:33 pm

User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Intentando compilar con FWH 10.9

Postby Antonio Linares » Sun Oct 17, 2010 10:46 pm

José Vicente,

La librería XMENU109.LIB es tuya ?

Tienes el código fuente ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Intentando compilar con FWH 10.9

Postby José Vicente Beltrán » Mon Oct 18, 2010 8:26 am

Daniel y Antonio, gracias por contestar.
Con la indicación de Daniel da otros problemas, en cuanto al codigo, No es mio, lo tomé del foro hace tiempo y no recuerdo quien es el autor, si por casualidad lee este post agradecería su ayuda.
El modulo que da el problema GRADFILL.C que no compila con BCC 582 es el siguiente:

Code: Select all  Expand view
#include <WinTen.h>  
#include <Windows.h>
#include <hbApi.h>  
#include <commctrl.h>
#include <StdLib.h>

void DegradColor( HDC hDC, RECT * rori, COLORREF cFrom, COLORREF cTo, int iType, int iRound )
{
   int clr1r, clr1g, clr1b, clr2r, clr2g, clr2b ;
   signed int iEle, iRed, iGreen, iBlue, iTot, iHalf ;
   BOOL bHorz = ( iType == 2 || iType == 4 ) ;
   BOOL bDir ;
   RECT rct ;
   HPEN hOldPen, hPen ;
   LOGBRUSH lb ;
   HBRUSH hOldBrush, hBrush, hNull ;

   rct.top = rori->top ;
   rct.left = rori->left ;
   rct.bottom = rori->bottom ;
   rct.right = rori->right ;

    iTot   = ( ! bHorz ? ( rct.bottom  - rct.top + 1 ) : ( rct.right - rct.left + 1 ) ) ;

   iHalf  = iTot / 2 ;
    lb.lbStyle = BS_NULL ;
    hNull  = CreateBrushIndirect(&lb) ;

   clr1r = GetRValue( cFrom ) ;
   clr1g = GetGValue( cFrom ) ;
   clr1b = GetBValue( cFrom ) ;

   clr2r = GetRValue( cTo ) ;
   clr2g = GetGValue( cTo ) ;
   clr2b = GetBValue( cTo ) ;

   iRed   =  abs( clr2r - clr1r ) ;
   iGreen =  abs( clr2g - clr1g ) ;
   iBlue  =  abs( clr2b - clr1b ) ;

   iRed   = ( iRed <= 0 ? 0 : ( iRed / iTot ) );
   iGreen = ( iGreen <= 0 ? 0 : ( iGreen / iTot ) ) ;
   iBlue  = ( iBlue <= 0 ? 0 : ( iBlue / iTot ) ) ;

   if( iType == 3 || iType == 4 )
   {
    iRed   *= 2 ;
      iGreen *= 2 ;
      iBlue  *= 2 ;
   }

   if( iType == 5 )
   {
      rct.top  += ( ( rct.bottom - rct.top ) / 2 ) ;
      rct.left += ( ( rct.right - rct.left ) / 2 ) ;
      rct.top  -= ( ( rct.bottom - rct.top ) / 3 ) ;
      rct.bottom = rct.top + 2 ;
      rct.right  = rct.left + 2 ;
   }
   else
   {
    if( ! bHorz )
        rct.bottom = rct.top + 1 ;
       else
        rct.right = rct.left + 1 ;
   }


   if( iType == 5 )
   {
       hPen      = CreatePen( PS_SOLID, 1, RGB( clr2r, clr2g, clr2b ) ) ;
    hOldPen   = SelectObject( hDC, hPen ) ;
        hBrush    = CreateSolidBrush( RGB( clr2r, clr2g, clr2b ) ) ;
    hOldBrush = SelectObject( hDC, hBrush ) ;
      if( iRound == 1 )
            Ellipse( hDC, rori->left, rori->top, rori->right, rori->bottom ) ;
      else
            RoundRect( hDC, rori->left, rori->top, rori->right, rori->bottom, 16, 16 ) ;

    SelectObject( hDC, hOldBrush ) ;
       DeleteObject( hBrush ) ;
    SelectObject( hDC, hOldPen ) ;
       DeleteObject( hPen ) ;
       hPen    = CreatePen( PS_SOLID, 2, RGB( clr1r, clr1g, clr1b ) ) ;
    hOldPen = SelectObject( hDC, hPen ) ;
    SelectObject( hDC, hNull ) ;
      if( iRound == 1 )
            Ellipse( hDC, rct.left, rct.top, rct.right, rct.bottom ) ;
      else
            RoundRect( hDC, rct.left, rct.top, rct.right, rct.bottom, 16, 16 ) ;

   }
   else
   {
       hPen      = CreatePen( PS_SOLID, 1, RGB( clr1r, clr1g, clr1b ) ) ;
    hOldPen   = SelectObject( hDC, hPen ) ;
        hBrush    = CreateSolidBrush( RGB( clr1r, clr1g, clr1b ) ) ;
    hOldBrush = SelectObject( hDC, hBrush ) ;
   }

   for( iEle = 1; iEle < iTot; iEle++ )
   {

        if( iType > 2 && iType < 5 && iEle > iHalf )
      {
        clr2r = GetRValue( cFrom ) ;
        clr2g = GetGValue( cFrom ) ;
        clr2b = GetBValue( cFrom ) ;
      }

      bDir = ( clr2r > clr1r ? TRUE : FALSE ) ;
      if( bDir )
        clr1r += iRed ;
      else
        clr1r -= iRed ;

      clr1r = ( clr1r < 0 ? 0 : clr1r > 255 ? 255 : clr1r ) ;

      bDir = ( clr2g > clr1g ? TRUE : FALSE  ) ;
      if( bDir )
        clr1g += iGreen ;
      else
        clr1g -= iGreen ;

      clr1g = ( clr1g < 0 ? 0 : clr1g > 255 ? 255 : clr1g ) ;

      bDir = ( clr2b > clr1b ? TRUE : FALSE  ) ;

      if( bDir )
        clr1b += iBlue ;
      else
        clr1b -= iBlue ;

      clr1b = ( clr1b < 0 ? 0 : clr1b > 255 ? 255 : clr1b ) ;

      if( iType == 5 )
      {
              SelectObject( hDC, hOldBrush ) ;
           DeleteObject( hNull ) ;
                hNull  = CreateBrushIndirect(&lb) ;
              SelectObject( hDC, hNull ) ;
          SelectObject( hDC, hOldPen ) ;
            DeleteObject( hPen ) ;
            hPen = CreatePen( PS_SOLID, 2, RGB( clr1r, clr1g, clr1b ) ) ;
            SelectObject( hDC, hPen ) ;
       if( iRound == 1 )
            Ellipse( hDC, rct.left, rct.top, rct.right + 1, rct.bottom + 1 ) ;
          else
            RoundRect( hDC, rct.left, rct.top, rct.right + 1, rct.bottom + 1, 16, 16 ) ;

          if( iRound == 1 )
            Ellipse( hDC, rct.left, rct.top, rct.right + 1, rct.bottom + 1 ) ;
        else
            RoundRect( hDC, rct.left, rct.top, rct.right + 1, rct.bottom + 1, 16, 16 ) ;

            rct.top    -= ( rct.top <= rori->top ? 0 : 1 ) ;
            rct.left   -= ( rct.left <= rori->left ? 0 : 1 );
            rct.bottom +=  ( rct.bottom >= rori->bottom ? 0 : 1 ) ;
            rct.right  +=  ( rct.right >= rori->right ? 0 : 1 ) ;
       }
      else
      {
          SelectObject( hDC, hOldBrush ) ;
       DeleteObject( hBrush ) ;
        hBrush = CreateSolidBrush( RGB( clr1r, clr1g, clr1b ) ) ;
          SelectObject( hDC, hBrush ) ;

        FillRect( hDC, &rct, hBrush ) ;

        if( ! bHorz )
        {
                rct.top++ ;
        rct.bottom++ ;
        }
        else
        {
            rct.left++ ;
            rct.right++ ;
        }
      }
   }
    SelectObject( hDC, hOldBrush ) ;
    SelectObject( hDC, hOldPen ) ;
   DeleteObject( hBrush ) ;
   DeleteObject( hPen ) ;
   DeleteObject( hNull ) ;
}

//---------------------------------------------------------------------------//

void DegardeFill( HDC hDC, RECT* rct, COLORREF crStart, COLORREF crEnd, int bVertical )
    {
       int nSegments = 100;
       COLORREF cr;
       int nR      = GetRValue(crStart);
       int nG      = GetGValue(crStart);
       int nB      = GetBValue(crStart);
       int neB     = GetBValue(crEnd);
       int neG     = GetGValue(crEnd);
       int neR     = GetRValue(crEnd);
       int nDiffR  = (neR - nR);
       int nDiffG  = (neG - nG);
       int nDiffB  = (neB - nB);
       int ndR ;
       int ndG ;
       int ndB ;
       int nCX ;
       int nCY ;
       int nTop    = rct->top;
       int nBottom ; //= rct->bottom;
       int nLeft   = rct->left;
       int nRight ; // = rct->right;
       HBRUSH hBrush;
       RECT rc;

       int i;

       if( !bVertical )
       {
          if( nSegments > ( rct->right - rct->left ) )
          {
            nSegments = ( rct->right - rct->left );
          }
       }
       else
       {
          if( nSegments > ( rct->bottom - rct->top ) )
          {
            nSegments = ( rct->bottom - rct->top );
          }
       }

       ndR = 256 * (nDiffR) / (max(nSegments,1));
       ndG = 256 * (nDiffG) / (max(nSegments,1));
       ndB = 256 * (nDiffB) / (max(nSegments,1));
       nCX = (rct->right-rct->left) / max(nSegments,1);
       nCY = (rct->bottom-rct->top) / max(nSegments,1);

       nR *= 256;
       nG *= 256;
       nB *= 256;

       for (i = 0; i < nSegments; i++, nR += ndR, nG += ndG, nB += ndB)
       {

               if(i == (nSegments - 1))
               {
                  nRight  = rct->right;
                  nBottom = rct->bottom;
               }
               else
               {
                  nBottom = nTop + nCY;
                  nRight = nLeft + nCX;
               }

               cr = RGB(nR / 256, nG / 256, nB / 256);

               {
                  hBrush = CreateSolidBrush( cr );
                  if( bVertical )
                  {
                     rc.top    = nTop;
                     rc.left   = rct->left;
                     rc.bottom = nBottom + 1;
                     rc.right  = rct->right;
                  }
                  else
                  {
                     rc.top    = rct->top;
                     rc.left   = nLeft;
                     rc.bottom = rct->bottom;
                     rc.right  = nRight+1;
                  }
                  FillRect(hDC, &rc, hBrush );
                  DeleteObject( hBrush );
               }

               nLeft = nRight;
               nTop = nBottom;
       }
    }

COLORREF MixedColor(COLORREF colorA,COLORREF colorB)
{
  // ( 86a + 14b ) / 100
  int red   = MulDiv(86,GetRValue(colorA),100) + MulDiv(14,GetRValue(colorB),100);
  int green = MulDiv(86,GetGValue(colorA),100) + MulDiv(14,GetGValue(colorB),100);
  int blue  = MulDiv(86,GetBValue(colorA),100) + MulDiv(14,GetBValue(colorB),100);

  return RGB( min(red,0xff),min(green,0xff), min(blue,0xff));
}

COLORREF MidColor(COLORREF colorA,COLORREF colorB)
{
  // (7a + 3b)/10
  int red   = MulDiv(7,GetRValue(colorA),10) + MulDiv(3,GetRValue(colorB),10);
  int green = MulDiv(7,GetGValue(colorA),10) + MulDiv(3,GetGValue(colorB),10);
  int blue  = MulDiv(7,GetBValue(colorA),10) + MulDiv(3,GetBValue(colorB),10);

  return RGB( min(red,0xff),min(green,0xff), min(blue,0xff));
}

COLORREF GrayColor(COLORREF crColor)
{
  int Gray  = (((int)GetRValue(crColor)) + GetGValue(crColor) + GetBValue(crColor))/3;

  return RGB( Gray,Gray,Gray);
}

BOOL IsLightColor(COLORREF crColor)
{
  return (((int)GetRValue(crColor)) + GetGValue(crColor) + GetBValue(crColor))>(3*128);
}

COLORREF BleachColor(int Add, COLORREF color)
{
  return RGB( min (GetRValue(color)+Add, 255),
              min (GetGValue(color)+Add, 255),
              min (GetBValue(color)+Add, 255));
}
//------------------------------------------------------//
HARBOUR HB_FUN_DARKENCOLORXP() //COLORREF lcolor)
{
  COLORREF lcolor = hb_parnl(1);
  hb_retnl( RGB( MulDiv(GetRValue(lcolor),7,10),
                 MulDiv(GetGValue(lcolor),7,10),
                 MulDiv(GetBValue(lcolor)+55,7,10)) );
}
//------------------------------------------------------//
HARBOUR HB_FUN_DARKENCOLOR() // long lScale, COLORREF lColor)
{
  COLORREF lColor = hb_parnl(2);
  LONG lScale = hb_parni(1);

  long red   = MulDiv(GetRValue(lColor),(255-lScale),255);
  long green = MulDiv(GetGValue(lColor),(255-lScale),255);
  long blue  = MulDiv(GetBValue(lColor),(255-lScale),255);

  hb_retnl( RGB(red, green, blue));
}

COLORREF DarkenColor(long lScale, COLORREF lColor)
{

  long red   = MulDiv(GetRValue(lColor),(255-lScale),255);
  long green = MulDiv(GetGValue(lColor),(255-lScale),255);
  long blue  = MulDiv(GetBValue(lColor),(255-lScale),255);

  return( RGB(red, green, blue));
}

//-------------------------------------------------------//
HARBOUR HB_FUN_LIGHTCOLOR( ) //long lScale, COLORREF lColor)
{
  COLORREF lColor = hb_parnl(2);
  LONG lScale = hb_parni(1);

  long R = MulDiv(255-GetRValue(lColor),lScale,255)+GetRValue(lColor);
  long G = MulDiv(255-GetGValue(lColor),lScale,255)+GetGValue(lColor);
  long B = MulDiv(255-GetBValue(lColor),lScale,255)+GetBValue(lColor);

  hb_retnl( RGB(R, G, B) );
}

COLORREF LightenColor( long lScale, COLORREF lColor)
{
  long R = MulDiv(255-GetRValue(lColor),lScale,255)+GetRValue(lColor);
  long G = MulDiv(255-GetGValue(lColor),lScale,255)+GetGValue(lColor);
  long B = MulDiv(255-GetBValue(lColor),lScale,255)+GetBValue(lColor);

  return( RGB(R, G, B) );
}

//-------------------------------------//

HARBOUR HB_FUN_DEGRADADO()
   {
           RECT rct;

           rct.top      = hb_parni( 2, 1 );
           rct.left     = hb_parni( 2, 2 );
           rct.bottom   = hb_parni( 2, 3 );
           rct.right    = hb_parni( 2, 4 );

           DegardeFill( ( HDC ) hb_parnl( 1 ) , &rct, hb_parnl( 3 ), hb_parnl( 4 ), hb_parl(5) );
   }
 


El resto de componentes originales que hay que compilar para generar la lib y cuyo codigo fuente tengo son:
MENUS.C, MENU.PRG, MENUITEM.PRG, MRU.PRG y PDMENU.PRG
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: Intentando compilar con FWH 10.9

Postby José Vicente Beltrán » Mon Oct 18, 2010 8:13 pm

Bueno ya estoy cercando el problema, lo que pasa es que mis conocimientos de C no me permiten ver donde está el error.
ocurre en el siguiente codigo al intentar generar la LIB

MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
"D:\FiveWin\bcc582\Bin\BCC32.EXE" -DHB_FM_STATISTICS_OFF -O2 -OS -tW -5 -c -w3 -6 -a8 -v- -k- -O1 -d -ID:\FiveWin\bcc582\Include -ID:\FiveWin\xharbour121\include;D:\trabajo32\comun\menu;D:\FiveWin\FWH28\INCLUDE;D:\FiveWin\FWH109\include -LD:\FiveWin\bcc582\Lib -o"D:\trabajo32\comun\menu\obj\MENUS.obj" "D:\trabajo32\comun\menu\MENUS.C"
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
D:\trabajo32\comun\menu\MENUS.C:
Error E2141 D:\trabajo32\comun\menu\MENUS.C 23: Declaration syntax error

Code: Select all  Expand view
#define OEMRESOURCE

#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>

BOOL bStrAt( BYTE bChar, LPSTR szText );
LPSTR StrToken( LPSTR szText, WORD wOcurrence, BYTE bSeparator, LPWORD pwLen );

void WindowBoxIn( HDC hDC, RECT * pRect );
void WndDrawBox( HDC hDC, RECT * rct, HPEN hPUpLeft, HPEN hPBotRit );
void WindowInset( HDC hDC, RECT * pRect );
void WindowRaised( HDC hDC, RECT * pRect );
void DrawBitmap( HDC, HBITMAP, WORD, WORD, WORD, WORD, DWORD );
void DrawMasked( HDC, HBITMAP, WORD, WORD );
void DrawGrayed( HDC, HBITMAP, int, int );
void RectDisable( HDC, LPRECT);
void DegardeFill( HDC hDC, RECT * rori, COLORREF cFrom, COLORREF cTo, int nDegType ) ;
void DegradColor( HDC hDC, RECT * rori, COLORREF cFrom, COLORREF cTo, int nDegType, int iRound ) ;

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_CREATEMENU( PARAMS )          //<---- aqui el problema  
{
   _retnl( ( LONG ) CreateMenu() );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_CREATEPOPUPMENU( PARAMS )
{
   _retnl( ( LONG ) CreatePopupMenu() );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_TRACKPOPUP( PARAMS )
{
  _retl( TrackPopupMenu( ( HMENU ) _parnl( 1 ), _parni( 2 ), _parni( 4 ),
         _parni( 3 ), _parni( 5 ), ( HWND ) _parni( 6 ), NULL ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_ENABLEMENUITEM( PARAMS )
{
   _retl( EnableMenuItem( ( HMENU ) _parnl( 1 ), _parni( 2 ), _parni( 3 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_CHECKMENUITEM( PARAMS )   // ()
{
   _retl( CheckMenuItem( ( HMENU ) _parnl( 1 ), _parni( 2 ), _parni( 3 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMITEMCOUNT( PARAMS )   // ()
{
   _retni( GetMenuItemCount( ( HMENU ) _parnl( 1 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMITEMID( PARAMS )    // hMenu, nPos
{
   _retni( GetMenuItemID( ( HMENU ) _parnl( 1 ), _parni( 2 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETSYSTEMMENU( PARAMS )    // ()
{
   _retnl( ( LONG ) GetSystemMenu( ( HWND ) _parnl( 1 ), _parl( 2 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_DESTROYMENU( PARAMS )   //  ()   hMenu
{
   _retl( DestroyMenu( ( HMENU ) _parnl( 1 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETSUBMENU( PARAMS )    // hMenu, nPos
{
   _retnl( ( LONG ) GetSubMenu( ( HMENU ) _parnl( 1 ), _parni( 2 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMENUSTRING( PARAMS )    // ()   hMenu, nId, nPosOrValue
{
   BYTE bBuffer[ 200 ];
   WORD wLen = GetMenuString( ( HMENU ) _parnl( 1 ), _parni( 2 ), ( char * ) bBuffer,
                              199, _parni( 3 ) );

   _retclen( ( char * ) bBuffer, wLen );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMENUSTATE( PARAMS )    // ()   hMenu, nId, nFlags
{
   _retni( GetMenuState( ( HMENU ) _parnl( 1 ), _parni( 2 ), _parni( 3 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_DRAWMENUBAR( PARAMS )    // ()    hWnd
{
   DrawMenuBar( ( HWND ) _parnl( 1 ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_HILITEMENUITEM( PARAMS )  // ()  hWnd, hMenu, idItem, nHiliteFlags
{
   _retl( HiliteMenuItem( ( HWND ) _parnl( 1 ), ( HMENU ) _parnl( 2 ),
                          _parni( 3 ), _parni( 4 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_LOADMENU( PARAMS )
{
   _retnl( ( LONG ) LoadMenu( ( HINSTANCE ) _parnl( 1 ),
                     ( LPSTR ) IF( ISCHAR( 2 ), _parc( 2 ),
                                   MAKEINTRESOURCE( _parni( 2 ) ) ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_APPENDMENU( PARAMS )
{
   _retl( AppendMenu( ( HMENU ) _parnl( 1 ), ( UINT ) _parnl( 2 ), _parnl( 3 ),
                       IF( ISCHAR( 4 ), _parc( 4 ), ( LPSTR ) _parnl( 4 ) ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_SETMENU( PARAMS )
{
   _retl( SetMenu( ( HWND ) _parnl( 1 ), ( HMENU ) _parnl( 2 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_MODIFYMENU( PARAMS )
{
   _retl( ModifyMenu( ( HMENU ) _parnl( 1 ), ( UINT ) _parni( 2 ),
          _parni( 3 ), ( UINT ) _parni( 4 ),
          IF( ISCHAR( 5 ), _parc( 5 ), ( LPSTR ) _parnl( 5 ) ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_INSERTMENU( PARAMS ) // ( hMenu, nIdItem, nFlags, nNewItem, cPrompt ) --> lSuccess
{
   _retl( InsertMenu( ( HMENU ) _parnl( 1 ), _parni( 2 ), _parni( 3 ),
                      _parni( 4 ), _parc( 5 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_REMOVEMENU( PARAMS ) // ( hMenu, nItem, nFlags ) --> lSuccess
{
   _retl( RemoveMenu( ( HMENU ) _parnl( 1 ),
                      ( UINT ) _parni( 2 ),
                      ( UINT ) _parni( 3 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_ATMENUDRAWITEM( PARAMS ) // ( pDrawItemStruct, cPrompt, lTop, hBitmap,lSeparator,acolor,lbar )
{
   LPDRAWITEMSTRUCT lpdis = ( LPDRAWITEMSTRUCT ) _parnl( 1 );
   LPSTR szPrompt = _parc( 2 );
   BOOL bTab = bStrAt( 9, szPrompt );
   WORD wLen;
   BOOL lSeparator = _parl( 5 );
   BOOL lBar       = _parl( 7 );
   HPEN hNormal,hOldPen;
   HBRUSH hBrush;
   LOGBRUSH lb;
   RECT rct;
   RECT rctdg;
   RECT rctsep;
   RECT rctshd;
   COLORREF nClrMenu     =  _parnl(6,1);
   COLORREF nClrMenuTxt  =  _parnl(6,2);
   COLORREF nClrBack     =  _parnl(6,3);
   COLORREF nClrTo       =  _parnl(6,4);
   COLORREF nClrHighBai  =  _parnl(6,5);
   COLORREF nClrHighBaf  =  _parnl(6,6);
   COLORREF nClrHighTxt  =  _parnl(6,7);
   COLORREF nClrHighBar  =  _parnl(6,8);

   HBITMAP hBmp = ( HBITMAP ) _parnl( 4 );
   switch( lpdis->itemAction )
   {
      case ODA_DRAWENTIRE:
      case ODA_SELECT:
           lb.lbStyle = BS_SOLID;
           lb.lbColor = nClrMenu;
           hBrush = CreateBrushIndirect( &lb );
           FillRect( lpdis->hDC, &lpdis->rcItem, hBrush );
           DeleteObject( hBrush );

           SetBkColor( lpdis->hDC, nClrMenu );
           SetBkMode( lpdis->hDC, TRANSPARENT );
           SetTextColor( lpdis->hDC, nClrMenuTxt);


           if( lpdis->itemState & ODS_SELECTED &&
               ! ( lpdis->itemState & ODS_GRAYED ) && !lSeparator )
           {
              lb.lbColor = nClrHighBai;
              SetBkColor( lpdis->hDC, nClrHighBai );
              SetTextColor( lpdis->hDC, nClrHighTxt );
              if( !lBar )
                lpdis->rcItem.left += 22;
           }
           else
              lb.lbColor = nClrMenu;


           hBrush = CreateBrushIndirect( &lb );
           FillRect( lpdis->hDC, &lpdis->rcItem, hBrush );
           DeleteObject( hBrush );
           if( lpdis->itemState & ODS_SELECTED &&
              ! ( lpdis->itemState & ODS_GRAYED ) )
           {
             if( !lBar )
                 lpdis->rcItem.left -= 22;
           }

           if(!lBar)
           {
             rct.top    = lpdis->rcItem.top+1;
             rct.left   = lpdis->rcItem.left+1;
             rct.right  = lpdis->rcItem.right-1; //22;
             rct.bottom = lpdis->rcItem.bottom - 2;
           }
           else
           {
             rct.top    = lpdis->rcItem.top+1;
             rct.left   = lpdis->rcItem.left+1;
             rct.right  = lpdis->rcItem.right-4;
             rct.bottom = lpdis->rcItem.bottom - 1;

             rctshd.top    = lpdis->rcItem.top+3;
             rctshd.left   = lpdis->rcItem.right-3;
             rctshd.right  = lpdis->rcItem.right;
             rctshd.bottom = lpdis->rcItem.bottom;

           }

           rctdg.top    = lpdis->rcItem.top-1; //-4
           rctdg.left   = lpdis->rcItem.left;
           rctdg.right  = 22;
           rctdg.bottom = lpdis->rcItem.bottom+1; // - 1;

           if( !lBar )
              DegradColor( lpdis->hDC, &rctdg, nClrBack, nClrTo, 2, 1 ) ;

           if( lpdis->itemState & ODS_SELECTED )
              if( ! ( lpdis->itemState & ODS_GRAYED ) ) //&&
                {
                     hNormal = CreatePen(PS_SOLID,0,nClrHighBar);
                     hOldPen = SelectObject(lpdis->hDC,hNormal);
                     Rectangle(lpdis->hDC,rct.left-1,rct.top-1,rct.right+1,rct.bottom+1);
                     SelectObject(lpdis->hDC,hOldPen);
                     DeleteObject( hNormal );
                     DegradColor( lpdis->hDC, &rct, nClrHighBai, nClrHighBaf, 1, 1 ) ;
                     if(lBar)
                     {
                       lb.lbColor = GetSysColor(16);
                       hBrush = CreateBrushIndirect( &lb );
                       FillRect( lpdis->hDC, &rctshd, hBrush );
                       DeleteObject( hBrush );
                       rctshd.top    = lpdis->rcItem.top;
                       rctshd.left   = lpdis->rcItem.right-3;
                       rctshd.right  = lpdis->rcItem.right;
                       rctshd.bottom = lpdis->rcItem.top+3;
                       lb.lbColor = nClrMenu;
                       hBrush = CreateBrushIndirect( &lb );
                       FillRect( lpdis->hDC, &rctshd, hBrush );
                       DeleteObject( hBrush );

                     }
                }
if(!lBar)
{

           if( lpdis->itemState & ODS_CHECKED )
           {
              HBITMAP hBmp = LoadBitmap( 0, MAKEINTRESOURCE( OBM_CHECK ) );

              if( ! ( lpdis->itemState & ODS_SELECTED ) )
                 DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 3,
                             lpdis->rcItem.left + 4 );
              else
                 DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 3,
                             lpdis->rcItem.left + 4 );
              DeleteObject( hBmp );
           }


           if( hBmp  && !( (int) hBmp == 1 )  )
           {
              if( ! ( lpdis->itemState & ODS_CHECKED ) )
                 DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 3, //ojo
                            lpdis->rcItem.left + 2 );
              else
                 if( ! ( lpdis->itemState & ODS_SELECTED ) )
                    DrawGrayed( lpdis->hDC, hBmp, lpdis->rcItem.top + 3,
                                lpdis->rcItem.left + 2 );
                 else
                    DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 3,
                                lpdis->rcItem.left + 2 );
           }
}
           if(!lBar)
           {
             lpdis->rcItem.top  += 4;
             lpdis->rcItem.left += 26;
           }
           else
           {
             lpdis->rcItem.top  += 2;
             lpdis->rcItem.left += 3;
           }            
           if( !bTab )
           {
              if( lSeparator )
              {
                 rctsep.top    = lpdis->rcItem.top-1;
                 rctsep.left   = lpdis->rcItem.left;
                 rctsep.right  = lpdis->rcItem.right+5;
                 rctsep.bottom = lpdis->rcItem.bottom - 4;
                 lb.lbStyle = BS_SOLID;
                 lb.lbColor = nClrHighBar ;
                 hBrush = CreateBrushIndirect( &lb );
                 FillRect( lpdis->hDC, &rctsep, hBrush );
                 DeleteObject( hBrush );
              }
              else
              {
              if(!lBar)
                {
                   DrawText( lpdis->hDC, szPrompt, -1, &lpdis->rcItem, DT_LEFT );
                }
                else
                {
                   lpdis->rcItem.left -= 5;
                   DrawText( lpdis->hDC, szPrompt, -1, &lpdis->rcItem, DT_CENTER );
                   lpdis->rcItem.left += 5;
                }
              }
           }
           else
           {
              lpdis->rcItem.right -= 26;
              StrToken( szPrompt, 1, 9, &wLen ); // 32 bits does not fill wLen before
              DrawText( lpdis->hDC, StrToken(szPrompt, 1, 9, &wLen), wLen, &lpdis->rcItem, DT_LEFT );
              StrToken( szPrompt, 2, 9, &wLen ); // 32 bits does not fill wLen before
              DrawText( lpdis->hDC, StrToken(szPrompt, 2, 9, &wLen), wLen, &lpdis->rcItem, DT_RIGHT );
              lpdis->rcItem.right += 26;
           }
           if(!lBar)
           {
             /*
              if( !lSeparator )
                {
                if( lpdis->itemState & ODS_GRAYED )
                   RectDisable( lpdis->hDC, &lpdis->rcItem );
                }
             */

             lpdis->rcItem.top  -= 4;
             lpdis->rcItem.left -= 26;
           }
           else
           {
             lpdis->rcItem.top  -= 2;
             lpdis->rcItem.left -= 4;
           }



           _retl( TRUE );
           break;

      case ODA_FOCUS:
           _retl( FALSE );
           break;
   }
}

//----------------------------------------------------------------------------//
/*
#ifdef __HARBOUR__
   CLIPPER MENUMEASUREITEM( PARAMS ) // ( pMeasureItemStruct, nLen )
#else
   CLIPPER MENUMEASUR( PARAMS ) // EITEM( pMeasureItemStruct, nLen )
#endif
{
   LPMEASUREITEMSTRUCT lp = ( LPMEASUREITEMSTRUCT ) _parnl( 1 );
   lp->itemWidth  = _parni( 2 );
   lp->itemHeight = GetSystemMetrics( SM_CYMENU ); //18
}
*/

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMEAITEM( PARAMS ) // ( pMeasureItemStruct ) --> nMenuItemID
{
   LPMEASUREITEMSTRUCT lp = ( LPMEASUREITEMSTRUCT ) _parnl( 1 );

   _retnl( lp->itemID );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETDRAWITEM( PARAMS ) // ( pDrawItemStruct ) --> nMenuItemID
{
   LPDRAWITEMSTRUCT lpdis = ( LPDRAWITEMSTRUCT ) _parnl( 1 );

   _retnl( lpdis->itemID );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETDRAWMENU( PARAMS ) // ( pDrawItemStruct ) --> hMenu
{
   LPDRAWITEMSTRUCT lpdis = ( LPDRAWITEMSTRUCT ) _parnl( 1 );

   _retnl( ( LONG ) lpdis->hwndItem );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_ISMENU( PARAMS )
{
   _retl( IsMenu( ( HMENU ) _parnl( 1 ) ) );
}

//----------------------------------------------------------------------------//

HB_FUNC( _GETMENUID)
{
    _retnl((LONG)GetMenu((HWND)_parnl(1)));
}

//----------------------------------------------------------------------------//

HB_FUNC ( _COLORMENU )
{
   HMENU      iMenu;
   MENUINFO   iMenuInfo ;
   COLORREF lColor = _parnl(2);
   BOOL  lSubMenu = _parl(3);
   HWND  himage ;

   himage = (HWND)LoadImage(0,_parc(4),IMAGE_BITMAP ,0,0,LR_LOADFROMFILE | LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT );

   if (himage==NULL)
     {
       himage = (HWND)LoadImage(GetModuleHandle(NULL),_parc(4),IMAGE_BITMAP ,0,0, LR_LOADMAP3DCOLORS    | LR_LOADTRANSPARENT );
     }
   iMenu              = GetMenu((HWND) _parnl(1));
   GetMenuInfo(iMenu, &iMenuInfo);
   iMenuInfo.cbSize   = sizeof(MENUINFO);
   iMenuInfo.dwStyle  = GetWindowLongPtr( (HWND) _parnl(1), GWL_STYLE );

   if (lSubMenu)
    {
      iMenuInfo.fMask    = MIM_BACKGROUND | MIM_APPLYTOSUBMENUS ;
    }
   else
    {
      iMenuInfo.fMask    = MIM_BACKGROUND;
    }

   if (himage==NULL)
    {
       iMenuInfo.hbrBack = CreateSolidBrush(lColor);
    }
   else
    {
       iMenuInfo.hbrBack = CreatePatternBrush( (HBITMAP) himage);
    }

   SetMenuInfo(iMenu, &iMenuInfo);
   DrawMenuBar((HWND) _parnl(1));

}

//----------------------------------------------------------------------------//

HB_FUNC ( _COLORSUBMENU )
{
   HMENU      iMenu;
   MENUINFO   iMenuInfo ;
   COLORREF lColor = _parnl(2);
   iMenu              = GetMenu((HWND) _parnl(1));
   GetMenuInfo(iMenu, &iMenuInfo);
   iMenuInfo.cbSize   = sizeof(MENUINFO);
   iMenuInfo.fMask    = MIM_BACKGROUND | MIM_APPLYTOSUBMENUS;
   iMenuInfo.hbrBack  = CreateSolidBrush(lColor);
   SetMenuInfo(iMenu, &iMenuInfo);
//   DrawMenuBar((HWND) _parnl(1));
}

//----------------------------------------------------------------------------//
HB_FUNC( CHGMENUMEA ) // pMeasureItemStruct, nWidth, nHeight
{
   LPMEASUREITEMSTRUCT lp = ( LPMEASUREITEMSTRUCT ) _parnl( 1 );
   lp->itemWidth  = _parni( 2 ) ;
   lp->itemHeight = _parni( 3 ) ;
}

HB_FUNC( GETDRAWISR ) // ( pDrawitemstruct )
{
   LPDRAWITEMSTRUCT lp = ( LPDRAWITEMSTRUCT ) _parnl( 1 );

   _reta( 12 );

   _storni( lp->CtlType      ,    -1, 1  );
   _storni( lp->CtlID        ,    -1, 2  );
   _storni( lp->itemID       ,    -1, 3  );
   _storni( lp->itemAction   ,    -1, 4  );
   _storni( lp->itemState    ,    -1, 5  );
   _storni( ( LONG ) lp->hwndItem     ,    -1, 6  );
   _storni( ( LONG ) lp->hDC          ,    -1, 7  );
   _storni( lp->rcItem.top   ,    -1, 8  );
   _storni( lp->rcItem.left  ,    -1, 9  );
   _storni( lp->rcItem.bottom,    -1, 10 );
   _storni( lp->rcItem.right ,    -1, 11 );
   _stornd( lp->itemData     ,    -1, 12 );

}

HB_FUNC( GETMEAUSUR ) // ( pMeasureItemStruct )
{
   LPMEASUREITEMSTRUCT lp = ( LPMEASUREITEMSTRUCT ) _parnl( 1 );

   _reta( 6 );

   _storni( lp->CtlType      ,    -1, 1  );
   _storni( lp->CtlID        ,    -1, 2  );
   _storni( lp->itemID       ,    -1, 3  );
   _storni( lp->itemWidth    ,    -1, 4  );
   _storni( lp->itemHeight   ,    -1, 5  );
   _stornd( lp->itemData     ,    -1, 12 );

}

//----------------------------------------------------------------------------//
 


Es una pena no poder recompilar el modulo en C, es una gran LIB :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: Intentando compilar con FWH 10.9

Postby Daniel Garcia-Gil » Mon Oct 18, 2010 8:16 pm

Jose

Tranquilo estoy preparandote la solucion
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Intentando compilar con FWH 10.9

Postby Daniel Garcia-Gil » Mon Oct 18, 2010 8:44 pm

Jose

esta es la linea que uso para compilar y no me genera error

(para el primer post)
c:\bcc582\bin\bcc32 -c -tWM -Ic:\xharbour\include -Ic:\fwh\include gradfill.c
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Intentando compilar con FWH 10.9

Postby Daniel Garcia-Gil » Mon Oct 18, 2010 9:08 pm

Jose

Prueba de esta forma
Code: Select all  Expand view

#define OEMRESOURCE

#include <WinTen.h>  
#include <Windows.h>
#include <hbApi.h>  
#include <commctrl.h>
#include <StdLib.h>

#define IF(x,y,z) ((x)?(y):(z))


BOOL bStrAt( BYTE bChar, LPSTR szText );
LPSTR StrToken( LPSTR szText, WORD wOcurrence, BYTE bSeparator, LPWORD pwLen );

void WindowBoxIn( HDC hDC, RECT * pRect );
void WndDrawBox( HDC hDC, RECT * rct, HPEN hPUpLeft, HPEN hPBotRit );
void WindowInset( HDC hDC, RECT * pRect );
void WindowRaised( HDC hDC, RECT * pRect );
void DrawBitmap( HDC, HBITMAP, WORD, WORD, WORD, WORD, DWORD );
void DrawMasked( HDC, HBITMAP, WORD, WORD );
void DrawGrayed( HDC, HBITMAP, int, int );
void RectDisable( HDC, LPRECT);
void DegardeFill( HDC hDC, RECT * rori, COLORREF cFrom, COLORREF cTo, int nDegType ) ;
void DegradColor( HDC hDC, RECT * rori, COLORREF cFrom, COLORREF cTo, int nDegType, int iRound ) ;

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_CREATEMENU(  )          //<---- aqui el problema  
{
   hb_retnl( ( LONG ) CreateMenu() );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_CREATEPOPUPMENU(  )
{
   hb_retnl( ( LONG ) CreatePopupMenu() );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_TRACKPOPUP(  )
{
  hb_retl( TrackPopupMenu( ( HMENU ) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 4 ),
         hb_parni( 3 ), hb_parni( 5 ), ( HWND ) hb_parni( 6 ), NULL ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_ENABLEMENUITEM(  )
{
   hb_retl( EnableMenuItem( ( HMENU ) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_CHECKMENUITEM(  )   // ()
{
   hb_retl( CheckMenuItem( ( HMENU ) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMITEMCOUNT(  )   // ()
{
   hb_retni( GetMenuItemCount( ( HMENU ) hb_parnl( 1 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMITEMID(  )    // hMenu, nPos
{
   hb_retni( GetMenuItemID( ( HMENU ) hb_parnl( 1 ), hb_parni( 2 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETSYSTEMMENU(  )    // ()
{
   hb_retnl( ( LONG ) GetSystemMenu( ( HWND ) hb_parnl( 1 ), hb_parl( 2 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_DESTROYMENU(  )   //  ()   hMenu
{
   hb_retl( DestroyMenu( ( HMENU ) hb_parnl( 1 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETSUBMENU(  )    // hMenu, nPos
{
   hb_retnl( ( LONG ) GetSubMenu( ( HMENU ) hb_parnl( 1 ), hb_parni( 2 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMENUSTRING(  )    // ()   hMenu, nId, nPosOrValue
{
   BYTE bBuffer[ 200 ];
   WORD wLen = GetMenuString( ( HMENU ) hb_parnl( 1 ), hb_parni( 2 ), ( char * ) bBuffer,
                              199, hb_parni( 3 ) );

   hb_retclen( ( char * ) bBuffer, wLen );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMENUSTATE(  )    // ()   hMenu, nId, nFlags
{
   hb_retni( GetMenuState( ( HMENU ) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_DRAWMENUBAR(  )    // ()    hWnd
{
   DrawMenuBar( ( HWND ) hb_parnl( 1 ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_HILITEMENUITEM(  )  // ()  hWnd, hMenu, idItem, nHiliteFlags
{
   hb_retl( HiliteMenuItem( ( HWND ) hb_parnl( 1 ), ( HMENU ) hb_parnl( 2 ),
                          hb_parni( 3 ), hb_parni( 4 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_LOADMENU(  )
{
   hb_retnl( ( LONG ) LoadMenu( ( HINSTANCE ) hb_parnl( 1 ),
                     ( LPSTR ) IF( ISCHAR( 2 ), hb_parc( 2 ),
                                   MAKEINTRESOURCE( hb_parni( 2 ) ) ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_APPENDMENU(  )
{
   hb_retl( AppendMenu( ( HMENU ) hb_parnl( 1 ), ( UINT ) hb_parnl( 2 ), hb_parnl( 3 ),
                       IF( ISCHAR( 4 ), hb_parc( 4 ), ( LPSTR ) hb_parnl( 4 ) ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_SETMENU(  )
{
   hb_retl( SetMenu( ( HWND ) hb_parnl( 1 ), ( HMENU ) hb_parnl( 2 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_MODIFYMENU(  )
{
   hb_retl( ModifyMenu( ( HMENU ) hb_parnl( 1 ), ( UINT ) hb_parni( 2 ),
          hb_parni( 3 ), ( UINT ) hb_parni( 4 ),
          IF( ISCHAR( 5 ), hb_parc( 5 ), ( LPSTR ) hb_parnl( 5 ) ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_INSERTMENU(  ) // ( hMenu, nIdItem, nFlags, nNewItem, cPrompt ) --> lSuccess
{
   hb_retl( InsertMenu( ( HMENU ) hb_parnl( 1 ), hb_parni( 2 ), hb_parni( 3 ),
                      hb_parni( 4 ), hb_parc( 5 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_REMOVEMENU(  ) // ( hMenu, nItem, nFlags ) --> lSuccess
{
   hb_retl( RemoveMenu( ( HMENU ) hb_parnl( 1 ),
                      ( UINT ) hb_parni( 2 ),
                      ( UINT ) hb_parni( 3 ) ) );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_ATMENUDRAWITEM(  ) // ( pDrawItemStruct, cPrompt, lTop, hBitmap,lSeparator,acolor,lbar )
{
   LPDRAWITEMSTRUCT lpdis = ( LPDRAWITEMSTRUCT ) hb_parnl( 1 );
   LPSTR szPrompt = ( char *)hb_parc( 2 );
   BOOL bTab = bStrAt( 9, szPrompt );
   WORD wLen;
   BOOL lSeparator = hb_parl( 5 );
   BOOL lBar       = hb_parl( 7 );
   HPEN hNormal,hOldPen;
   HBRUSH hBrush;
   LOGBRUSH lb;
   RECT rct;
   RECT rctdg;
   RECT rctsep;
   RECT rctshd;
   COLORREF nClrMenu     =  hb_parnl(6,1);
   COLORREF nClrMenuTxt  =  hb_parnl(6,2);
   COLORREF nClrBack     =  hb_parnl(6,3);
   COLORREF nClrTo       =  hb_parnl(6,4);
   COLORREF nClrHighBai  =  hb_parnl(6,5);
   COLORREF nClrHighBaf  =  hb_parnl(6,6);
   COLORREF nClrHighTxt  =  hb_parnl(6,7);
   COLORREF nClrHighBar  =  hb_parnl(6,8);

   HBITMAP hBmp = ( HBITMAP ) hb_parnl( 4 );
   switch( lpdis->itemAction )
   {
      case ODA_DRAWENTIRE:
      case ODA_SELECT:
           lb.lbStyle = BS_SOLID;
           lb.lbColor = nClrMenu;
           hBrush = CreateBrushIndirect( &lb );
           FillRect( lpdis->hDC, &lpdis->rcItem, hBrush );
           DeleteObject( hBrush );

           SetBkColor( lpdis->hDC, nClrMenu );
           SetBkMode( lpdis->hDC, TRANSPARENT );
           SetTextColor( lpdis->hDC, nClrMenuTxt);


           if( lpdis->itemState & ODS_SELECTED &&
               ! ( lpdis->itemState & ODS_GRAYED ) && !lSeparator )
           {
              lb.lbColor = nClrHighBai;
              SetBkColor( lpdis->hDC, nClrHighBai );
              SetTextColor( lpdis->hDC, nClrHighTxt );
              if( !lBar )
                lpdis->rcItem.left += 22;
           }
           else
              lb.lbColor = nClrMenu;


           hBrush = CreateBrushIndirect( &lb );
           FillRect( lpdis->hDC, &lpdis->rcItem, hBrush );
           DeleteObject( hBrush );
           if( lpdis->itemState & ODS_SELECTED &&
              ! ( lpdis->itemState & ODS_GRAYED ) )
           {
             if( !lBar )
                 lpdis->rcItem.left -= 22;
           }

           if(!lBar)
           {
             rct.top    = lpdis->rcItem.top+1;
             rct.left   = lpdis->rcItem.left+1;
             rct.right  = lpdis->rcItem.right-1; //22;
             rct.bottom = lpdis->rcItem.bottom - 2;
           }
           else
           {
             rct.top    = lpdis->rcItem.top+1;
             rct.left   = lpdis->rcItem.left+1;
             rct.right  = lpdis->rcItem.right-4;
             rct.bottom = lpdis->rcItem.bottom - 1;

             rctshd.top    = lpdis->rcItem.top+3;
             rctshd.left   = lpdis->rcItem.right-3;
             rctshd.right  = lpdis->rcItem.right;
             rctshd.bottom = lpdis->rcItem.bottom;

           }

           rctdg.top    = lpdis->rcItem.top-1; //-4
           rctdg.left   = lpdis->rcItem.left;
           rctdg.right  = 22;
           rctdg.bottom = lpdis->rcItem.bottom+1; // - 1;

           if( !lBar )
              DegradColor( lpdis->hDC, &rctdg, nClrBack, nClrTo, 2, 1 ) ;

           if( lpdis->itemState & ODS_SELECTED )
              if( ! ( lpdis->itemState & ODS_GRAYED ) ) //&&
                {
                     hNormal = CreatePen(PS_SOLID,0,nClrHighBar);
                     hOldPen = SelectObject(lpdis->hDC,hNormal);
                     Rectangle(lpdis->hDC,rct.left-1,rct.top-1,rct.right+1,rct.bottom+1);
                     SelectObject(lpdis->hDC,hOldPen);
                     DeleteObject( hNormal );
                     DegradColor( lpdis->hDC, &rct, nClrHighBai, nClrHighBaf, 1, 1 ) ;
                     if(lBar)
                     {
                       lb.lbColor = GetSysColor(16);
                       hBrush = CreateBrushIndirect( &lb );
                       FillRect( lpdis->hDC, &rctshd, hBrush );
                       DeleteObject( hBrush );
                       rctshd.top    = lpdis->rcItem.top;
                       rctshd.left   = lpdis->rcItem.right-3;
                       rctshd.right  = lpdis->rcItem.right;
                       rctshd.bottom = lpdis->rcItem.top+3;
                       lb.lbColor = nClrMenu;
                       hBrush = CreateBrushIndirect( &lb );
                       FillRect( lpdis->hDC, &rctshd, hBrush );
                       DeleteObject( hBrush );

                     }
                }
if(!lBar)
{

           if( lpdis->itemState & ODS_CHECKED )
           {
              HBITMAP hBmp = LoadBitmap( 0, MAKEINTRESOURCE( OBM_CHECK ) );

              if( ! ( lpdis->itemState & ODS_SELECTED ) )
                 DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 3,
                             lpdis->rcItem.left + 4 );
              else
                 DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 3,
                             lpdis->rcItem.left + 4 );
              DeleteObject( hBmp );
           }


           if( hBmp  && !( (int) hBmp == 1 )  )
           {
              if( ! ( lpdis->itemState & ODS_CHECKED ) )
                 DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 3, //ojo
                            lpdis->rcItem.left + 2 );
              else
                 if( ! ( lpdis->itemState & ODS_SELECTED ) )
                    DrawGrayed( lpdis->hDC, hBmp, lpdis->rcItem.top + 3,
                                lpdis->rcItem.left + 2 );
                 else
                    DrawMasked( lpdis->hDC, hBmp, lpdis->rcItem.top + 3,
                                lpdis->rcItem.left + 2 );
           }
}
           if(!lBar)
           {
             lpdis->rcItem.top  += 4;
             lpdis->rcItem.left += 26;
           }
           else
           {
             lpdis->rcItem.top  += 2;
             lpdis->rcItem.left += 3;
           }            
           if( !bTab )
           {
              if( lSeparator )
              {
                 rctsep.top    = lpdis->rcItem.top-1;
                 rctsep.left   = lpdis->rcItem.left;
                 rctsep.right  = lpdis->rcItem.right+5;
                 rctsep.bottom = lpdis->rcItem.bottom - 4;
                 lb.lbStyle = BS_SOLID;
                 lb.lbColor = nClrHighBar ;
                 hBrush = CreateBrushIndirect( &lb );
                 FillRect( lpdis->hDC, &rctsep, hBrush );
                 DeleteObject( hBrush );
              }
              else
              {
              if(!lBar)
                {
                   DrawText( lpdis->hDC, szPrompt, -1, &lpdis->rcItem, DT_LEFT );
                }
                else
                {
                   lpdis->rcItem.left -= 5;
                   DrawText( lpdis->hDC, szPrompt, -1, &lpdis->rcItem, DT_CENTER );
                   lpdis->rcItem.left += 5;
                }
              }
           }
           else
           {
              lpdis->rcItem.right -= 26;
              StrToken( szPrompt, 1, 9, &wLen ); // 32 bits does not fill wLen before
              DrawText( lpdis->hDC, StrToken(szPrompt, 1, 9, &wLen), wLen, &lpdis->rcItem, DT_LEFT );
              StrToken( szPrompt, 2, 9, &wLen ); // 32 bits does not fill wLen before
              DrawText( lpdis->hDC, StrToken(szPrompt, 2, 9, &wLen), wLen, &lpdis->rcItem, DT_RIGHT );
              lpdis->rcItem.right += 26;
           }
           if(!lBar)
           {
             /*
              if( !lSeparator )
                {
                if( lpdis->itemState & ODS_GRAYED )
                   RectDisable( lpdis->hDC, &lpdis->rcItem );
                }
             */

             lpdis->rcItem.top  -= 4;
             lpdis->rcItem.left -= 26;
           }
           else
           {
             lpdis->rcItem.top  -= 2;
             lpdis->rcItem.left -= 4;
           }



           hb_retl( TRUE );
           break;

      case ODA_FOCUS:
           hb_retl( FALSE );
           break;
   }
}

//----------------------------------------------------------------------------//
/*
#ifdef __HARBOUR__
   CLIPPER MENUMEASUREITEM(  ) // ( pMeasureItemStruct, nLen )
#else
   CLIPPER MENUMEASUR(  ) // EITEM( pMeasureItemStruct, nLen )
#endif
{
   LPMEASUREITEMSTRUCT lp = ( LPMEASUREITEMSTRUCT ) hb_parnl( 1 );
   lp->itemWidth  = hb_parni( 2 );
   lp->itemHeight = GetSystemMetrics( SM_CYMENU ); //18
}
*/

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETMEAITEM(  ) // ( pMeasureItemStruct ) --> nMenuItemID
{
   LPMEASUREITEMSTRUCT lp = ( LPMEASUREITEMSTRUCT ) hb_parnl( 1 );

   hb_retnl( lp->itemID );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETDRAWITEM(  ) // ( pDrawItemStruct ) --> nMenuItemID
{
   LPDRAWITEMSTRUCT lpdis = ( LPDRAWITEMSTRUCT ) hb_parnl( 1 );

   hb_retnl( lpdis->itemID );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_GETDRAWMENU(  ) // ( pDrawItemStruct ) --> hMenu
{
   LPDRAWITEMSTRUCT lpdis = ( LPDRAWITEMSTRUCT ) hb_parnl( 1 );

   hb_retnl( ( LONG ) lpdis->hwndItem );
}

//----------------------------------------------------------------------------//

HARBOUR HB_FUN_ISMENU(  )
{
   hb_retl( IsMenu( ( HMENU ) hb_parnl( 1 ) ) );
}

//----------------------------------------------------------------------------//

HB_FUNC( _GETMENUID)
{
    hb_retnl((LONG)GetMenu((HWND)hb_parnl(1)));
}

//----------------------------------------------------------------------------//

HB_FUNC ( _COLORMENU )
{
   HMENU      iMenu;
   MENUINFO   iMenuInfo ;
   COLORREF lColor = hb_parnl(2);
   BOOL  lSubMenu = hb_parl(3);
   HWND  himage ;

   himage = (HWND)LoadImage(0,hb_parc(4),IMAGE_BITMAP ,0,0,LR_LOADFROMFILE | LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT );

   if (himage==NULL)
     {
       himage = (HWND)LoadImage(GetModuleHandle(NULL),hb_parc(4),IMAGE_BITMAP ,0,0, LR_LOADMAP3DCOLORS    | LR_LOADTRANSPARENT );
     }
   iMenu              = GetMenu((HWND) hb_parnl(1));
   GetMenuInfo(iMenu, &iMenuInfo);
   iMenuInfo.cbSize   = sizeof(MENUINFO);
   iMenuInfo.dwStyle  = GetWindowLongPtr( (HWND) hb_parnl(1), GWL_STYLE );

   if (lSubMenu)
    {
      iMenuInfo.fMask    = MIM_BACKGROUND | MIM_APPLYTOSUBMENUS ;
    }
   else
    {
      iMenuInfo.fMask    = MIM_BACKGROUND;
    }

   if (himage==NULL)
    {
       iMenuInfo.hbrBack = CreateSolidBrush(lColor);
    }
   else
    {
       iMenuInfo.hbrBack = CreatePatternBrush( (HBITMAP) himage);
    }

   SetMenuInfo(iMenu, &iMenuInfo);
   DrawMenuBar((HWND) hb_parnl(1));

}

//----------------------------------------------------------------------------//

HB_FUNC ( _COLORSUBMENU )
{
   HMENU      iMenu;
   MENUINFO   iMenuInfo ;
   COLORREF lColor = hb_parnl(2);
   iMenu              = GetMenu((HWND) hb_parnl(1));
   GetMenuInfo(iMenu, &iMenuInfo);
   iMenuInfo.cbSize   = sizeof(MENUINFO);
   iMenuInfo.fMask    = MIM_BACKGROUND | MIM_APPLYTOSUBMENUS;
   iMenuInfo.hbrBack  = CreateSolidBrush(lColor);
   SetMenuInfo(iMenu, &iMenuInfo);
//   DrawMenuBar((HWND) hb_parnl(1));
}

//----------------------------------------------------------------------------//
HB_FUNC( CHGMENUMEA ) // pMeasureItemStruct, nWidth, nHeight
{
   LPMEASUREITEMSTRUCT lp = ( LPMEASUREITEMSTRUCT ) hb_parnl( 1 );
   lp->itemWidth  = hb_parni( 2 ) ;
   lp->itemHeight = hb_parni( 3 ) ;
}

HB_FUNC( GETDRAWISR ) // ( pDrawitemstruct )
{
   LPDRAWITEMSTRUCT lp = ( LPDRAWITEMSTRUCT ) hb_parnl( 1 );

   hb_reta( 12 );

   hb_storni( lp->CtlType      ,    -1, 1  );
   hb_storni( lp->CtlID        ,    -1, 2  );
   hb_storni( lp->itemID       ,    -1, 3  );
   hb_storni( lp->itemAction   ,    -1, 4  );
   hb_storni( lp->itemState    ,    -1, 5  );
   hb_storni( ( LONG ) lp->hwndItem     ,    -1, 6  );
   hb_storni( ( LONG ) lp->hDC          ,    -1, 7  );
   hb_storni( lp->rcItem.top   ,    -1, 8  );
   hb_storni( lp->rcItem.left  ,    -1, 9  );
   hb_storni( lp->rcItem.bottom,    -1, 10 );
   hb_storni( lp->rcItem.right ,    -1, 11 );
   hb_stornd( lp->itemData     ,    -1, 12 );

}

HB_FUNC( GETMEAUSUR ) // ( pMeasureItemStruct )
{
   LPMEASUREITEMSTRUCT lp = ( LPMEASUREITEMSTRUCT ) hb_parnl( 1 );

   hb_reta( 6 );

   hb_storni( lp->CtlType      ,    -1, 1  );
   hb_storni( lp->CtlID        ,    -1, 2  );
   hb_storni( lp->itemID       ,    -1, 3  );
   hb_storni( lp->itemWidth    ,    -1, 4  );
   hb_storni( lp->itemHeight   ,    -1, 5  );
   hb_stornd( lp->itemData     ,    -1, 12 );

}

//----------------------------------------------------------------------------//
 
 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Intentando compilar con FWH 10.9

Postby José Vicente Beltrán » Mon Oct 18, 2010 9:48 pm

Daniel, ante todo agradecer tu interés.

1. La linea de GRADFILL.C ya compila perfectamente pero...
2. La linea de MENUS.C después de los cambios que propones sigue generando el error

"D:\FiveWin\bcc582\Bin\BCC32.EXE" -DHB_FM_STATISTICS_OFF -O2 -OS -tW -5 -c -w3 -6 -a8 -v- -k- -O1 -d -ID:\FiveWin\bcc582\Include -ID:\FiveWin\xharbour121\include;D:\trabajo32\comun\menu;D:\FiveWin\FWH28\INCLUDE;D:\FiveWin\FWH109\include -LD:\FiveWin\bcc582\Lib -o"D:\trabajo32\comun\menu\obj\MENUS.obj" "D:\trabajo32\comun\menu\MENUS.C"
Borland C++ 5.82 for Win32 Copyright (c) 1993, 2005 Borland
D:\trabajo32\comun\menu\MENUS.C:
Error E2141 D:\trabajo32\comun\menu\MENUS.C 27: Declaration syntax error :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España

Re: Intentando compilar con FWH 10.9

Postby Daniel Garcia-Gil » Mon Oct 18, 2010 9:59 pm

Jose

no presento eso error, me compila sin problemas
estas usando el codigo que publique?
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Intentando compilar con FWH 10.9

Postby José Vicente Beltrán » Tue Oct 19, 2010 3:13 pm

Daniel te pido disculpas porque no compilaba el codigo con TODAS las modificaciones que sugerías, ahora ya está solucionado y la LIB se genera perfectamente.

Además de un buen programador eres un gran compañero por todas las molestias que te has tomado con mi problema :D , gracias de nuevo.

saludos :shock:
User avatar
José Vicente Beltrán
 
Posts: 282
Joined: Mon Oct 10, 2005 8:55 am
Location: Algeciras, España


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 74 guests