gpt4 book ai didi

vba - 如何检测计算机是 32 位还是 64 位?

转载 作者:行者123 更新时间:2023-12-04 17:27:28 25 4
gpt4 key购买 nike

你如何确定你使用的计算机是 32 位机器还是 64 位机器?

我需要最好在 vba 中完成。

最佳答案


http://www.msoffice.us/Access/PDF/Extending%20VBA%20with%20APIs.pdf 。似乎它正在我的工作。

Option Compare Database

Type SYSTEM_INFO
wProcessorArchitecture As Integer
wReserved As Integer
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
wProcessorLevel As Integer
wProcessorRevision As Integer
End Type

Declare Sub GetNativeSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Declare Function GetCurrentProcess Lib "kernel32" () As Long

Public Function Is64BitProcessor() As Boolean
Const PROCESSOR_ARCHITECTURE_AMD64 As Integer = 9
Const PROCESSOR_ARCHITECTURE_IA64 As Integer = 6
Dim si As SYSTEM_INFO
' call the API
GetNativeSystemInfo si
' check the struct
Is64BitProcessor = (si.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64 _
Or _
si.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_IA64)
End Function

http://msdn.microsoft.com/en-us/library/ms724340(v=vs.85).aspx

关于vba - 如何检测计算机是 32 位还是 64 位?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6256140/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com