When compiling for 32-bit Windows, GetWindowLongPtr is defined as a call to the GetWindowLong function.
******************************************************************************
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( NEXTMEM ) // --> nHardwareMemory
{
MEMORYSTATUSEX mst;
memset( &mst, 0, sizeof( MEMORYSTATUSEX ) );
mst.dwLength = sizeof( MEMORYSTATUSEX );
GlobalMemoryStatusEx( &mst );
hb_retnll( mst.ullAvailPhys );
}
#pragma ENDDUMP
******************************************************************************
#pragma BEGINDUMP
#include <stdio.h>
#include <Windows.h>
#include <WinINet.h>
#include <hbapi.h>
#include <hbapiitm.h>
#include <hbapifs.h>
#include <hbvm.h>
#include <hbstack.h>
static int mystrcmp( char *val1, char *val2 )
{
int nret = 0 ;
for ( ; *val1 ; val1++, val2++ ) {
if ( ! *val2 || *val1 != *val2 ) {
nret = 1 ;
break ;
}
}
if ( ! nret && *val2 )
nret = 1 ;
return nret ;
}
HB_FUNC( DELFILECACHE )
{
BOOL bResult = FALSE ;
BOOL bDone = FALSE ;
LPINTERNET_CACHE_ENTRY_INFO lpCacheEntry = NULL ;
DWORD dwTrySize, dwEntrySize = 4096 ; // start buffer size
HANDLE hCacheDir = NULL ;
DWORD dwError = ERROR_INSUFFICIENT_BUFFER ;
BOOL bSuccess ;
PHB_ITEM iFiles, iElem ;
int nfile, npos ;
char buffile[FILENAME_MAX] ;
iFiles = hb_itemParam( 1 ) ;
nfile = hb_parinfa( 1, 0 ) ;
do {
switch ( dwError ) {
// need a bigger buffer
case ERROR_INSUFFICIENT_BUFFER :
if ( lpCacheEntry != NULL )
free( (LPBYTE)lpCacheEntry ) ;
lpCacheEntry = (LPINTERNET_CACHE_ENTRY_INFO) malloc( dwEntrySize ) ;
lpCacheEntry->dwStructSize = dwEntrySize ;
dwTrySize = dwEntrySize ;
if ( hCacheDir == NULL )
bSuccess = (hCacheDir = FindFirstUrlCacheEntry( NULL, lpCacheEntry, &dwTrySize )) != NULL ;
else
bSuccess = FindNextUrlCacheEntry(hCacheDir, lpCacheEntry, &dwTrySize ) ;
if ( bSuccess )
dwError = ERROR_SUCCESS ;
else {
dwError = GetLastError() ;
dwEntrySize = dwTrySize ; // use new size returned
}
break ;
// we are done
case ERROR_NO_MORE_ITEMS :
bDone = TRUE ;
bResult = TRUE ;
break ;
// we have got an entry
case ERROR_SUCCESS:
// don't delete cookie entry
if ( !( lpCacheEntry->CacheEntryType & COOKIE_CACHE_ENTRY ) ) {
for ( npos = 1 ; npos <= nfile ; npos++ ) {
iElem = hb_itemArrayGet( iFiles, npos ) ;
hb_itemCopyC( iElem, buffile, 0 ) ;
buffile[hb_itemSize( iElem )] = '\0' ;
if ( ! mystrcmp( (char *)(lpCacheEntry->lpszSourceUrlName), buffile ) ) {
DeleteUrlCacheEntry( lpCacheEntry->lpszSourceUrlName ) ;
break ;
}
}
}
// get ready for next entry
dwTrySize = dwEntrySize;
if ( FindNextUrlCacheEntry(hCacheDir, lpCacheEntry, &dwTrySize ) )
dwError = ERROR_SUCCESS ;
else {
dwError = GetLastError() ;
dwEntrySize = dwTrySize ; // use new size returned
}
break;
// unknown error
default:
bDone = TRUE ;
break ;
}
if ( bDone ) {
free( (LPBYTE)lpCacheEntry ) ;
if ( hCacheDir )
FindCloseUrlCache( hCacheDir ) ;
}
} while ( !bDone ) ;
hb_retnl( bResult ) ;
}
#pragma ENDDUMP
*****************************************************************************
#pragma BEGINDUMP
#include <windows.h>
LONG WINAPI GetWindowLongPtr( HWND hWnd, int nIndex )
{
return GetWindowLong( HWND hWnd, int nIndex );
}
#pragma ENDDUMP
*****************************************************************************
Improper use of typedef 'HWND' in function GetWindowLongA
Function call ) missing in function GetWindowLongA
#ifndef __BORLANDC__
#pragma BEGINDUMP
#include <windows.h>
LONG WINAPI GetWindowLongPtr( HWND hWnd, int nIndex )
{
return GetWindowLong( HWND hWnd, int nIndex );
}
#pragma ENDDUMP
#endif
driessen wrote:Antonio,
I just deleted your code and everything is ok with build 2.
Thanks a lot.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 32 guests