|
Определение свободной памяти
|
|||
---|---|---|---|
#18+
как определить количество свободной памяти? я делаю следующее: в разделе Global External Functions объявляю внешнюю функцию /* function ulong GetFreeSpace(uint dummy) library "kernel.exe" */ затем в событии открытии окна пишу её вызов что-то типа: /* Int dummy long memory memory=GetFreeSpace(dummy) sle_1.Text=String(memory) */ выдаётся ошибка Bad Runtime function reference и т.п. ... |
|||
:
Нравится:
Не нравится:
|
|||
14.08.2003, 09:44 |
|
Определение свободной памяти
|
|||
---|---|---|---|
#18+
У тебя, что 16 разрядное приложение под win? Если так, то конечно все правильно.... А если все-таки 32 разр., то : // Get free memory Subroutine GlobalMemoryStatus (ref os_memorystatus memorystatus ) Library "KERNEL32.DLL" type os_memorystatus from structure unsignedlong ul_length unsignedlong ul_memoryload unsignedlong ul_totalphys unsignedlong ul_availphys unsignedlong ul_totalpagefile unsignedlong ul_availpagefile unsignedlong ul_totalvirtual unsignedlong ul_availvirtual end type ////////////////////////////////////////////////////////////////////////////// // // Function: of_GetFreeMemory // // Access: public // // Arguments: none // // // Returns: long - bytes of memory // // // Description: returns the number of bytes of memory currently available // ////////////////////////////////////////////////////////////////////////////// // // Revision History // // Version // 5.0 Initial version // ////////////////////////////////////////////////////////////////////////////// // // Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved. // Any distribution of the PowerBuilder Foundation Classes (PFC) // source code by other than Sybase, Inc. and its subsidiaries is prohibited. // ////////////////////////////////////////////////////////////////////////////// os_memorystatus lstr_memory //structure size is 8 ulong's or 8 * 4 bytes lstr_memory.ul_length = 32 GlobalMemoryStatus(lstr_memory) //bytes of virtual memory available Return (lstr_memory.ul_availpagefile) Т.е. на твоем месте я бы использовал pfc или хотя бы туда смотрел... И в следующий раз пиши более подробно, какую всетаки ошибку выдает... ... |
|||
:
Нравится:
Не нравится:
|
|||
14.08.2003, 10:38 |
|
|
start [/forum/topic.php?fid=15&msg=32236121&tid=1339551]: |
0ms |
get settings: |
8ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
397ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
49ms |
get tp. blocked users: |
2ms |
others: | 15ms |
total: | 503ms |
0 / 0 |