Skip to Content
avatar image
Former Member

PB12.6 64-bit issue: GlobalMemoryStatus

I am deploying my PB12.6 app as 64-bit.

Calls to GlobalMemoryStatus are returning low memory.

This is not correct as the memory exists and the 32-bit deployment works.

What can I do to rectify? I read somewhare that I should use GlobalMemoryStatusEx instead.

I tried that but my 32-bit deployment reported low memory!

My app is using the pfc libraries.

Is there a need to convert many function calls to run 64-bit?

Thanks in advance.

Larry

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 08, 2015 at 12:20 PM

    Hi Larry

    you can modify your object by replacing the external function so:

    GlobalMemoryStatusEx local exernal function definition is:

    Subroutine GlobalMemoryStatus (ref os_memorystatus memorystatus ) Library "KERNEL32.DLL" alias for "GlobalMemoryStatusEx"

    the new  os_memorystatus definition is:

    type os_memorystatus from structure

        unsignedlong ul_length

        unsignedlong ul_memoryload

        longlong ll_totalphys

        longlong ll_availphys

        longlong ll_totalpagefile

        longlong ll_availpagefile

        longlong ll_totalvirtual

        longlong ll_availvirtual

        longlong ll_AvailExtendedVirtual

    end type

    before calling the api you have to set

    lstr_memory.ul_length = 64 instead of 32

    hope this helps

    Alberto

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 08, 2015 at 09:32 PM

    Thanks Alberto.

    That fixed my problem.

    I notice that lstr_memory.ul_length = 64 works in 32-bit.

    Is this safe or should I only use 64 when running in 64-bit mode?

    Thanks anyway

    Larry

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Bruce Armstrong

      @Bruce

      env.processbitness is zero when I execute a 64-bit compiled app with PB 12.6 Classic BUILD 4058

      I'll try to install again PB12.6 and EBFs to verify It is not a problem in the install process.

  • avatar image
    Former Member
    Jan 08, 2015 at 12:50 PM

    Hi Larry;

      Alberto's code is correct. I had to change this in my STD Foundation Classes many years ago as the Appeon Web product makes your Web Browser PB applications 64 bit automatically.

    Note: For those using Appeon Mobile .. you need to use Appeon's "eon_mobile_deviceex" class to get the actual tablet or smartphones memory status.

    Regards ... Chris

    Add comment
    10|10000 characters needed characters exceeded