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

typedef struct
{
   LONG lStyle;
   BYTE bControls;
   WORD wLeft, wTop, wWidth, wHeight;
} DIALOG_RES;

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

CLIPPER cDlg2Chr()
{
   BYTE bBuffer[ 200 ];
   WORD wLen = sizeof( DIALOG_RES );
   LPSTR szText;

   ( ( DIALOG_RES * ) bBuffer )->bControls = _parni( 1 );

//   ( ( DIALOG_RES * ) bBuffer )->wLeft     = ( _parni( 3 ) * 390 ) / 100;
//   ( ( DIALOG_RES * ) bBuffer )->wTop      = ( _parni( 2 ) * 730 ) / 100;
//   ( ( DIALOG_RES * ) bBuffer )->wWidth    = ( ( _parni( 5 ) - _parni( 3 ) + 1 ) * 390 ) / 100;
//   ( ( DIALOG_RES * ) bBuffer )->wHeight   = ( ( _parni( 4 ) - _parni( 2 ) + 1 ) * 730 ) / 100;

   ( ( DIALOG_RES * ) bBuffer )->wLeft     = _parni( 3 );
   ( ( DIALOG_RES * ) bBuffer )->wTop      = _parni( 2 );
   ( ( DIALOG_RES * ) bBuffer )->wWidth    = _parni( 5 ) - _parni( 3 ) + 1;
   ( ( DIALOG_RES * ) bBuffer )->wHeight   = _parni( 4 ) - _parni( 2 ) + 1;

   ( ( DIALOG_RES * ) bBuffer )->lStyle    = _parnl( 7 );

   bBuffer[ wLen++ ] = 0;
   bBuffer[ wLen++ ] = 0;
   szText = _parc( 6 );
   while( * szText )
      bBuffer[ wLen++ ] = * szText++;
   bBuffer[ wLen++ ] = 0;

   _retclen( bBuffer, wLen );
}

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

CLIPPER GETDLGBASE() // Units() --> nBaseUnits
{
    _retnl( GetDialogBaseUnits() );
}

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