FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Antonio: Minor Bugs on 64Bit
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Antonio: Minor Bugs on 64Bit
Posted: Mon Apr 18, 2016 02:01 PM

Antonio,
GetCPUSpeed() and nExtMem() gives wrong results on 64Bit!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Minor Bugs on 64Bit
Posted: Mon Apr 18, 2016 03:29 PM

Günther,

Could you check:

"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz"

and compare it with 32 bits GetCPUSpeed() value ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Minor Bugs on 64Bit
Posted: Mon Apr 18, 2016 03:38 PM
This should work fine on 64 bits:

Code (fw): Select all Collapse
HB_FUNC( NEXTMEM ) // --> nHardwareMemory
{
   MEMORYSTATUSEX mst;

   memset( &mst, 0, sizeof( MEMORYSTATUSEX ) );
   mst.dwLength = sizeof( MEMORYSTATUSEX );

   GlobalMemoryStatusEx( &mst );

   hb_retnll( mst.ullTotalPhys );
}
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Minor Bugs on 64Bit
Posted: Mon Apr 18, 2016 08:05 PM
Antonio, in 16.03 GetCPUSpeed() is coded to "999". No support for 64 in source!
"HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0\~MHz"
and compare it with 32 bits GetCPUSpeed() value ?


nextmem() gives in 64 a negative value! I will test this further tomorrow.
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Minor Bugs on 64Bit
Posted: Tue Apr 19, 2016 05:26 PM

Antonio, GetCPUSpeed() gives also in 32Bit different values. From 183Mhz over 2017Mhz(is right) to 3719Mhz.
In 64Bit gives always 999Mhz. I see on source, the function is not ready!
nExtmem gives in 32Bit the correct value, in 64 Bit gives a ( cValToChar( Int( nExtMem() / ( 1024 * 1024 ) ) + 1 ) ) the value of minus(!)-1062

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Minor Bugs on 64Bit
Posted: Mon Apr 25, 2016 08:16 AM

Antonio, any news on that problems?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Minor Bugs on 64Bit
Posted: Mon Apr 25, 2016 11:23 AM

Günther,

I have been busy working to complete the Windows 10 Toasts support.

How may I help you ? Is the info from the registry ok ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Minor Bugs on 64Bit
Posted: Tue Apr 26, 2016 08:49 AM

Antonio, in case of the memory-size i compile your code with Borland 7.1 and the result is ok! With the libs from FWH the result is wrong and negative. Maybe you are not compile the mem.c in the right way??
The GetCPUSpeed() gives always 999. You should write a new function for 64Bit or use the registry-value. It seems to be nearly right.

Antonio, see also viewtopic.php?f=3&t=32188&p=189722#p189722. There are problems with nextmem()!

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Minor Bugs on 64Bit
Posted: Tue Apr 26, 2016 09:55 AM

Günther,

  • Fix: function nExtMem() is returning now the same value in both
    32 and 64 bits. It keeps returning zero for xHb.com

Included in FWH 16.04

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Antonio: Minor Bugs on 64Bit
Posted: Tue Apr 26, 2016 10:26 AM

Günther,

  • Fix: function GetCpuSpeed() now reads from the registry and returns
    the same value in 32 and 64 bits.

Included in FWH 16.04

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Antonio: Minor Bugs on 64Bit
Posted: Tue Apr 26, 2016 11:43 AM

Antonio, thanks! Super, as all time!

Regards,
Günther
---------------------------------
office@byte-one.com

Continue the discussion