Help to antonio

Help to antonio

Postby Silvio » Mon Oct 10, 2005 11:05 pm

I trying to convert old program ( 16 bit) to xharbour and now my xmate make me errors :

::nWidth := pBmpWidth ( ::hBmp )
::nHeight := pBmpHeight( ::hBmp )

these func exist or not ?

Regards
Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: Help to antonio

Postby Antonio Linares » Tue Oct 11, 2005 7:52 am

Silvio,

Silvio wrote:I trying to convert old program ( 16 bit) to xharbour and now my xmate make me errors :

::nWidth := pBmpWidth ( ::hBmp )
::nHeight := pBmpHeight( ::hBmp )

these func exist or not ?


Use:

::nWidth := nBmpWidth ( ::hBmp )
::nHeight := nBmpHeight( ::hBmp )
regards, saludos

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

Postby Silvio » Tue Oct 11, 2005 1:41 pm

thanks Antonio
but now I am a problem to convert two file c ( clipper ) into xharbour can you help me I can send they on email ?
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Tue Oct 11, 2005 1:46 pm

this is one
Code: Select all  Expand view
#include <WinTen.h>
#include <Windows.h>
#include <ClipApi.h>


CLIPPER xVScrll() // ( hWnd, wRows, nHRow, nRows, lHeader, nHeader )
{
   HWND hWnd     = _parni( 1 );
   WORD wRows    = _parni( 2 );
   int  nHRow    = _parni( 3 );
   int  nRows    = _parni( 4 );
   HDC hDC     = GetDC( hWnd );
   RECT rct;
   BOOL bHeader = _parl( 5 );
   WORD nHeader = _parni( 6 );

   GetClientRect( hWnd, &rct );

   if ( bHeader )
      rct.top    = nHeader + 1;
      rct.bottom = ( nHRow * nRows ) - 1;
      ScrollWindowEx( hWnd, 0, -( nHRow * wRows ), 0, &rct, 0, 0, 0 );
      ReleaseDC( hWnd, hDC );
}

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

CLIPPER xHScrll() // ( hWnd, nCols, nLeft, nRight )
{
   HWND hWnd     = _parni( 1 );
   WORD wCols    = _parni( 2 );
   int nLeft   = _parni( 3 );
   int nRight  = _parni( 4 );
   HDC hDC     = GetDC( hWnd );
   RECT rct;

   GetClientRect( hWnd, &rct );

   if ( nLeft ) {
      rct.left = nLeft;
   }

   if ( nRight ) {
      rct.right = nRight;
   }


   ScrollWindowEx( hWnd, wCols, 0, 0, &rct, 0, 0, 0 );


   ReleaseDC( hWnd, hDC );
}

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





and this another
Code: Select all  Expand view
#include "WinTen.h"
#include <Windows.h>
#include "ClipApi.h"

void pascal Dos3Call( void );

#define SUBSTDRIVE 0x8000
#define NETDRIVE   0x1000

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

CLIPPER cDrives()   // It returns an string with all the valid drives ids
{
   BYTE b,c;
   BYTE drives[ 26 ];
   BYTE nDrives = 0;
   c = 0;

   for( b = 0; b < 26; b++ )
      drives[ b ] = ' ';

   for( b = 0; b < 26; b++ )
   {
      // drives[ b ] = ' ';

      _AX = 0x4409;
      _BL = b;
      Dos3Call();

      if( ! ( _FLAGS & 1 ) )
        {
         drives[ c++ ] = 'A' + b - ( b >= 1 );
         nDrives++;
      }
   }

   _retclen( drives+1 , nDrives - 1);
}

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




Can You help me ...

Regards
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Antonio Linares » Tue Oct 11, 2005 4:10 pm

Silvio,

The first functions are quite easy. Just add "hb" before the "_" of the extend system functions. Please review Harbour C source code RTL functions to get lots of examples.

Regarding the second one, you have to implement it using a Win32 API call as Dos3Call() is not supported in Win32.
regards, saludos

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

Postby Silvio » Tue Oct 11, 2005 7:58 pm

Dear Antonio,
if you remember they are two prg ( c) of grid : I'm try to converte the old classes of Canal5
On olivares2000 there are some classes of canal5 but there is not the grid class, i just converte today the banner class with help of Paco.
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Carlos Mora » Thu Oct 13, 2005 10:06 am

Silvio wrote:Dear Antonio,
if you remember they are two prg ( c) of grid : I'm try to converte the old classes of Canal5
On olivares2000 there are some classes of canal5 but there is not the grid class, i just converte today the banner class with help of Paco.


Code: Select all  Expand view
dll32 static function ;
      AcpGetDrives( nLength AS LONG, ;
                    @cBuffer AS STRING ) ;
      AS LONG PASCAL FROM "GetLogicalDriveStringsA" ;
      LIB "kernel32.dll"

function GetLocalDrives()

local nError := 0
local x := 0
local cDrives := Space( 78 )
local aDrives := {}

AcpGetDrives( 78, @cDrives )

for x:= 1 to 78 step 4
if !Empty( StrTran( SubStr( cDrives, x, 3 ), Chr( 0 ), "" ) )
AAdd( aDrives, SubStr( cDrives, x, 3 ) )
endif
next

return aDrives
Carlos Mora
 

Postby Silvio » Thu Oct 13, 2005 8:15 pm

thanks...
but i have another problems to onverte grid class
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Postby Silvio » Mon Oct 17, 2005 8:47 am

thanks to all
I asked help to paco and we have resolve all ..
the func driver is not important
Now the classes tbanner and grid canal5 run ok but there is only one small error for the footer of canal5 grid class .

Thanks to all
silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 12 guests