how much available memory 
Author Message
 how much available memory

Hello:

This is probably an easy one but I went through two VB6 books and could not
find an answer.  Is there a way to determine the amount of memory available
from within a VB6 program?  I would like my program to start, load some data
etc and then display the available memory before the user selects certain
parameters so they can make a choice that will not cause the program to
exceed the available memory.

Thanks, Gene



Sun, 07 Aug 2005 22:42:44 GMT  
 how much available memory



Quote:
> Hello:

> This is probably an easy one but I went through two VB6 books and could
not
> find an answer.  Is there a way to determine the amount of memory
available
> from within a VB6 program?  I would like my program to start, load some
data
> etc and then display the available memory before the user selects certain
> parameters so they can make a choice that will not cause the program to
> exceed the available memory.

> Thanks, Gene

Hi
You must use API function, for example as below:

Private Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type

Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As
MEMORYSTATUS)

Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/

Dim MemStat As MEMORYSTATUS
'retrieve the memory status
GlobalMemoryStatus MemStat
MsgBox "You have" + Str$(MemStat.dwTotalPhys / 1024) + " Kb total memory
and" + Str$(MemStat.dwAvailPageFile / 1024) + " Kb available PageFile
memory."

End Sub

Best Regards
                      PawelT.



Mon, 08 Aug 2005 17:26:15 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How i can get the Used Memory and Available Memory

2. POWERBASIC freeing up all available memory

3. Differences in available memory between compiled/interp?

4. Total Available Memory

5. How can I track available memory?

6. Checking Available memory from vb app

7. PPC available memory

8. How to get total system memory (Ram) and available memory?

9. Available Memory and Passwords

10. Can you check available conventional memory ?

11. available memory

12. How much memory is available?

 

 
Powered by phpBB® Forum Software