, , , , , VBA, .NET. IntPtr - .NET, , . 32- 32 , 64- 64 .
, HKL typedef , typedef PVOID, typedef VOID *, , , .NET.
VBA 64- , .
64- - :
Public Type HKL64
High As Long
Low As Long
End Type
Private Declare Function ActivateKeyboardLayout Lib "user32" ( _
Byval HklHigh As Long, Byval HklLow As Long, _
ByVal flags As Integer) As HKL64
64- API ( ). , 64- 32- , API, , .
, VBA, API, , 64- ( 32).
On the other hand, the original ActivateKeyboardLayout declaration is incorrect because it had an Integer return type, which is a 16-bit value, while the API returns an HKL type, which is 32 or 64 bits, depending on the platform.
source
share