
04-30-2017, 01:05 AM
|
Ultimate Contributor
|
|
Join Date: Jul 2002
Location: Hamilton, Ontario
Posts: 1,859
|
|
4 Byte Hex To Long (Big Endian format)
Following is my code to convert a 4 byte Hex value in Big Endian format to a Long.
0x0007A120 = 500,000
How can I go the other way?
Code:
Private Sub Command1_Click()
'0x0007A120
Dim dwMsg As Long
Dim byte1 As Byte
Dim byte2 As Byte
Dim byte3 As Byte
Dim byte4 As Byte
byte1 = &H0
byte2 = &H7
byte3 = &HA1
byte4 = &H20
dwMsg = (byte4) Or (byte3 * 2 ^ 8) Or (byte2 * 2 ^ 16) Or (byte1 * 2 ^ 24)
MsgBox dwMsg
End Sub
|
|