用于 64 位 VISUAL BASIC 的更新

UPDATE FOR USE ON 64-BIT- VISUAL BASIC

我写了这条消息:

The code in this project must be updated for use on 64-bit systems. Lease review and update Declare statements and then mark them with the PtrSafe attribute.

我该怎么办?

Public Declare Function GetUserDefaultLCID Lib "kernel32" () As Long
Public Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Public Declare Function GetThreadLocale Lib "kernel32" () As Long
'
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Public Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Long

只需在 Function 之前添加 PtrSafe 关键字。见下文。您需要为每个函数添加此关键字。

Public Declare PtrSafe Function GetUserDefaultLCID Lib "kernel32" () As Long

另请阅读微软的这两篇文章。

Article 1, Article 2