Results 1 to 4 of 4

Thread: Determining the Processors in a machine

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    9
    Does anyone know how to determine the number of CPU's in a machine>

    Visual Basic 5 SP3 and JavaScript

  2. #2
    New Member
    Join Date
    Aug 2000
    Posts
    1

    Cool

    check out

    http://www.vbsquare.com/tips/tip443.html

    It will answer all your questions

  3. #3
    Addicted Member
    Join Date
    Aug 2000
    Location
    Adelaide - Australia
    Posts
    150
    'Copy code into Module
    Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)

    Type SYSTEM_INFO
    dwOemID As Long
    dwPageSize As Long
    lpMinimumApplicationAddress As Long
    lpMaximumApplicationAddress As Long
    dwActiveProcessorMask As Long
    dwNumberOrfProcessors As Long
    dwProcessorType As Long
    dwAllocationGranularity As Long
    dwReserved As Long
    End Type

    Public Const PROCESSOR_INTEL_386 = 386
    Public Const PROCESSOR_INTEL_486 = 486
    Public Const PROCESSOR_INTEL_PENTIUM = 586
    Public Const PROCESSOR_MIPS_R4000 = 4000
    Public Const PROCESSOR_ALPHA_21064 = 21064


    Public Function GetProcessor()
    Dim V As SYSTEM_INFO, Info$
    Dim NoOfProcessors$, ProcessorType$, PageSize$

    GetSystemInfo V

    NoOfProcessors = V.dwNumberOrfProcessors
    ProcessorType = V.dwProcessorType

    Select Case ProcessorType
    Case PROCESSOR_INTEL_386
    Info = Info & "Intel 386" & vbCrLf
    Case PROCESSOR_INTEL_486
    Info = Info & "Intel 486" & vbCrLf
    Case PROCESSOR_INTEL_PENTIUM
    Info = Info & "Intel Pentium" & vbCrLf
    Case PROCESSOR_MIPS_R4000
    Info = Info & "MIPS R4000" & vbCrLf
    Case PROCESSOR_ALPHA_21064
    Info = Info & "DEC Alpha 21064" & vbCrLf
    Case Else
    Info = Info & "(unknown)" & vbCrLf
    End Select

    GetProcessor = "No of Processors: " & NoOfProcessors & vbCrLf & "Processor Type: " & Info
    End Function


    'Call Function
    'eg.
    'MsgBox GetProcessor

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    9
    Thanks I will give these a try

    Visual Basic 5 SP3 and JavaScript

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