CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: memoery

  1. #1
    Guest

    memoery

    how do i check how much memory is left in a computer?


  2. #2
    Join Date
    Dec 1999
    Location
    Tel Aviv, Israel, Earth, Solar System
    Posts
    50

    Re: memoery

    What memory are you talking (writing) about?

    If you mean Hard Disk then go to
    'My Computer'
    Right Click on the drive you want to ckeck
    Choose Properties and there you are...

    If you mean RAM, then I think that only NT has info on it's RAM. In Win 9x you can use MemTurbo wich not only shows but even frees up memory for you. You can download trial version from www.memturbo.com

    Jean Spector
    Tech Support Team Leader, CET
    [email protected]
    (in VB from 11/1999)

  3. #3
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: memoery

    On Windows 2000 and Windows NT, right click on the task bar and select from the pop up menu: Task Manager. Then click on the Performance Tab where you can see graphically all the info you need!

    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

  4. #4
    Join Date
    Jul 1999
    Posts
    145

    Re: memoery

    You can get the memory status through code with the GlobalMemoryStatus API. And don't forget to copy the MEMORYSTATUS type from the api viewer


  5. #5
    Join Date
    Nov 1999
    Location
    California, USA
    Posts
    40

    Re: memoery

    YOU GUYS ARE A BUNCH OF STUPIDASSES!!!!! he is talking about the code to get the (ram)random access memory from the computer. sorry i dont no the code for that, sorry

    PanasonicSubz

  6. #6
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: memoery

    You really do endear yourself to the rest of the VB community don't you ?

    So what if these people have given different answers to the guys question ? You don't have to (try and) insult anyone on this group just because they bothered to answer in the first place. The forum exists because people need help, and other people try to help out - it's a two way thing where people on both sides learn from posting.

    I've not had to ban anyone from this forum yet, so be a good little boy and apologise huh ?

    As for the original question - you used to be able to use the 'GetMemoryInfo' (? or similar) API call under windows 3.1 but since the change to 32bit windows, this feature isn't as accurate anymore due to the virtual memory that windows uses all the time (ie. switching to disk). I'll dig out an old example if I can find one.


    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  7. #7
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: memoery

    Mike was on the correct track, here's some code I just tried out on NT4
    (may work on Win98). Again though, you shouldn't believe everything that
    you get back from this call (for instance, you can still run out of GDI
    resources no matter what this api call returns):


    Take a form (FORM1) with a command button (Command1) and paste in the
    following code :


    option Explicit
    '
    private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer as MEMORYSTATUS)
    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 Sub Command1_Click()
    Dim ms as MEMORYSTATUS
    '
    ms.dwLength = len(ms)
    '
    Call GlobalMemoryStatus(ms)
    '
    With ms
    Debug.print "memory load : " & .dwMemoryLoad
    Debug.print "Total Phys : " & .dwTotalPhys
    Debug.print "Avail Phys : " & .dwAvailPhys
    Debug.print "Total Page File : " & .dwTotalPageFile
    Debug.print "Avail Page File : " & .dwAvailPageFile
    Debug.print "Total Virtual : " & .dwTotalVirtual
    Debug.print "Avail Virtual : " & .dwAvailVirtual
    End With
    '
    End Sub





    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  8. #8
    Join Date
    Dec 1999
    Location
    Tel Aviv, Israel, Earth, Solar System
    Posts
    50

    Re: memoery

    Hi there! I've found an answer on some VB site, I just can't remember where. Because you're Anonymous, I can't send it to you. Send me email with your address and you'll have it.
    P.S. If you're afraid of spammers you can create special address for this one. Keep in touch.

    Jean Spector
    Tech Support Team Leader, CET
    [email protected]
    (in VB from 11/1999)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured