Thanks for that. The 2nd one was the one I was expecting but didn't know what the declaration had to be. I'll study the 1st one too.
Cheers
Glen
Karl-Heinz wrote:HI Glen,
f you want to stay with the the dynamic calls, there are two options:
1. keep the untyped hfunc ptr and useinstead ofCode: Select all
PCallNative <LOGIC> ( hFunc , GetCurrentProcess() , @lIsWow64 )
Code: Select all
PCall(hFunc ,GetCurrentProcess(), @lIsWow64)
2. or change hFunc to a typed function ptrCode: Select all
FUNCTION PCE_Is64BitOS() AS LOGIC LOCAL hModule AS PTR LOCAL hFunc AS PTR LOCAL lIsWow64 AS LOGIC hModule := GetModuleHandle( String2Psz( "kernel32" ) ) hFunc := GetProcAddress( hModule, String2Psz( "IsWow64Process" ) ) IF ! hFunc == NULL_PTR PCallNative <LOGIC> ( hFunc , GetCurrentProcess() , @lIsWow64 ) ENDIF RETURN lIsWow64
regardsCode: Select all
FUNCTION PCE_Is64BitOS() AS LOGIC LOCAL hModule AS PTR LOCAL hFunc AS __IsWow64Process PTR LOCAL lIsWow64 AS LOGIC hModule := GetModuleHandle( String2Psz( "kernel32" ) ) hFunc := GetProcAddress( hModule, String2Psz( "IsWow64Process" ) ) IF ! hFunc == NULL_PTR PCALL( hFunc, GetCurrentProcess(), @lIsWow64 ) ENDIF RETURN lIsWow64 STATIC FUNCTION __IsWow64Process( hProcess AS PTR , Wow64Process AS LOGIC PTR ) AS LOGIC RETURN FALSE
Karl-Heinz