nosotros, los desarrolladores, nos limitamos a probar el programa cinco minutos
Antonio Linares wrote:Totalmente de acuerdo con hmpaquito
He sido más apasionado que lógico en mi análisis. Lo primero a comprobar es lo primero, y no se pueden obviar todas las comprobaciones básicas que de forma excelente te ha explicado hmpaquito
//---------------------------------------------------------------------------//
HB_FUNC( CDLG2CHR )
{
BYTE bBuffer[ 250 ];
WORD wLen = sizeof( DIALOG_RES );
HB_FUNC( CDLG2CHR )
{
WORD wLen = sizeof( DIALOG_RES );
WORD wSize = sizeof( DIALOG_RES ) + ( hb_parclen( 6 ) * 2 ) +
1 + 2 + ( hb_parclen( 9 ) * 2 ) + 3;
BYTE * bBuffer = hb_xgrab( wSize );
LPSTR szText;
int iLenUnicode;
memset( ( char * ) bBuffer, 0, wSize );
( ( DIALOG_RES * ) bBuffer )->bControls = ( short ) hb_parni( 1 );
( ( DIALOG_RES * ) bBuffer )->wLeft = ( short ) hb_parnl( 3 );
( ( DIALOG_RES * ) bBuffer )->wTop = ( short ) hb_parnl( 2 );
( ( DIALOG_RES * ) bBuffer )->wWidth = ( short ) hb_parnl( 5 ) - ( short ) hb_parnl( 3 ) + 1;
( ( DIALOG_RES * ) bBuffer )->wHeight = ( short ) hb_parnl( 4 ) - ( short ) hb_parnl( 2 ) + 1;
( ( DIALOG_RES * ) bBuffer )->lStyle = hb_parnl( 7 );
#ifndef UNICODE
#ifdef __FLAT__
if( ( ( DIALOG_RES * ) bBuffer )->lStyle == DS_SYSMODAL )
{
( ( DIALOG_RES * ) bBuffer )->lStyle |= WS_POPUP;
( ( DIALOG_RES * ) bBuffer )->dwExtendedStyle = WS_EX_TRANSPARENT;
}
if( ( ( DIALOG_RES * ) bBuffer )->lStyle == WS_VISIBLE ) // XPP bug with LONGs
( ( DIALOG_RES * ) bBuffer )->lStyle = WS_POPUP | WS_CHILD;
#endif
#endif
bBuffer[ wLen++ ] = 0;
bBuffer[ wLen++ ] = 0;
#ifdef __FLAT__
#ifdef __BORLANDC__ // MSVC++ different alignment
bBuffer[ wLen++ ] = 0;
bBuffer[ wLen++ ] = 0;
#endif
#endif
szText = ( char * ) hb_parc( 6 );
#ifdef __FLAT__
iLenUnicode = MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED,
szText, -1, ( LPWSTR ) ( bBuffer + wLen ), 0 );
MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED, szText,
-1, ( LPWSTR ) ( bBuffer + wLen ), iLenUnicode );
wLen += ( iLenUnicode * 2 );
if( hb_pcount() == 7 ) // Align to DWORD boundary if no DS_SETFONT provided
{
ULONG l = ( ULONG ) wLen;
l +=3;
l >>=2;
l <<=2;
wLen = ( WORD ) l;
}
// font info
if( hb_pcount() > 7 )
{
bBuffer[ wLen++ ] = LOBYTE( hb_parni( 8 ) );
bBuffer[ wLen++ ] = HIBYTE( hb_parni( 8 ) );
iLenUnicode = MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED,
hb_parc( 9 ), -1, ( LPWSTR ) ( bBuffer + wLen ), 0 );
MultiByteToWideChar( CP_OEMCP, MB_PRECOMPOSED, hb_parc( 9 ),
-1, ( LPWSTR ) ( bBuffer + wLen ), iLenUnicode );
wLen += ( iLenUnicode * 2 );
// Align to DWORD boundary
{
ULONG l = ( ULONG ) wLen;
l +=3;
l >>=2;
l <<=2;
wLen = ( WORD ) l;
}
}
#else
while( * szText )
bBuffer[ wLen++ ] = * szText++;
bBuffer[ wLen++ ] = 0;
if( hb_pcount() > 7 )
{
bBuffer[ wLen++ ] = LOBYTE( hb_parni( 8 ) );
bBuffer[ wLen++ ] = HIBYTE( hb_parni( 8 ) );
szText = hb_parc( 9 ); // FontName
while( * szText )
bBuffer[ wLen++ ] = * szText++;
bBuffer[ wLen++ ] = 0;
}
#endif
// if( wLen == wSize )
// MessageBox( 0, "they are the same", "ok", 0 );
hb_retclen( ( char * ) bBuffer, wLen );
hb_xfree( bBuffer );
}
Felicitarte, antes que nada, por haber cazado un bug de FiveWin que lleva muchooo tiempo con nosotros y que nadie habia visto aún Muchisimas gracias!
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 43 guests