2009-10-19 14:54 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/src/common/hbwince.c
    + added GetEnvironmentVariableW() - it fixes WinCE builds after recent
      ANSI to UNICODE function conversions. In WINCE such functions do not
      exist.

  * harbour/src/rtl/gtclip.c
    * pacified MinGWCE warnings

  * harbour/src/rtl/dateshb.c
    + added HB_TTOD() and HB_DTOT() functions
This commit is contained in:
Przemyslaw Czerpak
2009-10-19 12:54:46 +00:00
parent 0e1f0f34e9
commit 890b9ac2ad
4 changed files with 64 additions and 2 deletions

View File

@@ -17,6 +17,18 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-10-19 14:54 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/common/hbwince.c
+ added GetEnvironmentVariableW() - it fixes WinCE builds after recent
ANSI to UNICODE function conversions. In WINCE such functions do not
exist.
* harbour/src/rtl/gtclip.c
* pacified MinGWCE warnings
* harbour/src/rtl/dateshb.c
+ added HB_TTOD() and HB_DTOT() functions
2009-10-19 11:53 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprb.c
! always optimized ASC() and LEN() functions (was disabled by -kc switch).

View File

@@ -228,6 +228,36 @@ DWORD WINAPI GetEnvironmentVariableA( LPCSTR name, LPSTR value, DWORD size )
return size;
}
DWORD WINAPI GetEnvironmentVariableW( LPCWSTR name, LPWSTR value, DWORD size )
{
/* use registry instead of "environment valuable". */
HKEY hk;
LONG lret;
DWORD dwType = REG_SZ, result = 0;
lret = RegOpenKeyEx( HKEY_LOCAL_MACHINE, TEXT( "Software\\harbour_mswince" ), 0, KEY_QUERY_VALUE, &hk );
if( lret != ERROR_SUCCESS )
{
if( value && size )
value[ 0 ] = '\0';
return 0;
}
result = size * sizeof( TCHAR );
lret = RegQueryValueExW( hk, name, NULL, &dwType, ( LPBYTE ) value, &result );
RegCloseKey( hk );
if( lret != ERROR_SUCCESS )
{
if( value && size )
value[ 0 ] = '\0';
return value ? 0 : result;
}
return result;
}
BOOL WINAPI SetEnvironmentVariableA( LPCSTR name, LPCSTR value )
{
HB_SYMBOL_UNUSED( name );

View File

@@ -229,6 +229,26 @@ HB_FUNC( HB_DATETIME )
hb_rettdt( lDate, lTime );
}
HB_FUNC( HB_DTOT )
{
long lDate, lTime;
if( hb_partdt( &lDate, &lTime, 1 ) )
hb_retdl( lDate );
else
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( HB_TTOD )
{
long lDate, lTime;
if( hb_partdt( &lDate, &lTime, 1 ) )
hb_rettdt( lDate, lTime );
else
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( HB_NTOT )
{
PHB_ITEM pNum = hb_param( 1, HB_IT_NUMERIC );

View File

@@ -140,7 +140,7 @@ BOOL hb_gt_winapi_setClipboard( UINT uFormat, const char * szClipData, ULONG ulL
}
fResult = TRUE;
}
GlobalUnlock( hglbCopy );
( void ) GlobalUnlock( hglbCopy );
/* Place the handle on the clipboard. */
SetClipboardData( uFormat, hglbCopy );
}
@@ -188,7 +188,7 @@ BOOL hb_gt_winapi_getClipboard( UINT uFormat, char ** pszClipData, ULONG *pulLen
}
break;
}
GlobalUnlock( hglb );
( void ) GlobalUnlock( hglb );
}
}
CloseClipboard();