Important fix!

Post Reply
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Important fix!

Post by Antonio Linares »

Please add this code to your FWPPC main PRG:

Code: Select all

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

LPSTR WideToAnsi( LPWSTR );

HB_FUNC( GETWINDOWTEXT )
{
   HWND hWnd = ( HWND ) hb_parnl( 1 );
   int iLen = GetWindowTextLength( hWnd );
   LPWSTR pText = ( LPWSTR ) hb_xgrab( ( iLen * 2 ) + 2 );
   LPSTR pAnsi;
   
   GetWindowText( hWnd, pText, iLen + 1 );
   
   pAnsi = WideToAnsi( pText );
   hb_retc( pAnsi );
   hb_xfree( pAnsi );
   hb_xfree( pText );
}	

#pragma ENDDUMP 
regards, saludos

Antonio Linares
www.fivetechsoft.com
pawelu
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland
Contact:

Post by pawelu »

Antonio,

What this code change ?

Thanks
Pawel
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Pawel,

It fixes internal memory corruption. Anyhow a new FWPPC build is coming with more changes.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply