FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Important fix!
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Important fix!
Posted: Fri Oct 20, 2006 09:15 AM
Please add this code to your FWPPC main PRG:
#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
Posts: 126
Joined: Thu Oct 06, 2005 10:18 PM
Important fix!
Posted: Fri Oct 20, 2006 10:49 AM

Antonio,

What this code change ?

Thanks
Pawel

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Important fix!
Posted: Fri Oct 20, 2006 12:50 PM

Pawel,

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

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion