Góc giúp đỡ: Lỗi Compile error

Liên hệ QC

giangnt95

Thành viên mới
Tham gia
29/5/19
Bài viết
39
Được thích
1
Nhờ anh chị xem và sửa lỗi giúp e file e download đc trên mạng nhưng tải về máy mở file ý ra bị báo lỗi như hình dưới ạ. Em cảm ơn ạ. Chưa có tên.png
 

File đính kèm

  • HRM (Ver0.0).rar
    899.1 KB · Đọc: 3
Nhờ anh chị xem và sửa lỗi giúp e file e download đc trên mạng nhưng tải về máy mở file ý ra bị báo lỗi như hình dưới ạ. Em cảm ơn ạ. View attachment 238527
Lỗi do mấy hàm API không tương thích với hệ thống 64 bit. Đã sửa lại, bạn mở file xem thế nào nhé
------------------------------------------------------------------
Toàn bộ các hàm đã sửa:
Mã:
Private Declare PtrSafe Function SetTimer Lib "user32" Alias "SetTimer" _
    (ByVal hWnd As LongPtr, ByVal nIDEvent As LongPtr, ByVal uElapse As Long, ByVal lpTimerFunc As LongPtr) As LongPtr
Private Declare PtrSafe Function KillTimer Lib "user32" Alias "KillTimer" _
    (ByVal hwnd As LongPtr, ByVal nIDEvent As LongPtr) As Long

Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Declare PtrSafe Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" _
    (ByVal hwnd As LongPtr, ByVal nIndex As Long) As LongPtr
Private Declare PtrSafe Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" -
    (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr

Public Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr
Public Declare PtrSafe Function GetDesktopWindow Lib "user32" () As LongPtr
 

File đính kèm

  • HRM (Ver0.0).rar
    910.3 KB · Đọc: 9
Upvote 0
Lỗi do mấy hàm API không tương thích với hệ thống 64 bit. Đã sửa lại, bạn mở file xem thế nào nhé
------------------------------------------------------------------
Toàn bộ các hàm đã sửa:
Mã:
Private Declare PtrSafe Function SetTimer Lib "user32" Alias "SetTimer" _
    (ByVal hWnd As LongPtr, ByVal nIDEvent As LongPtr, ByVal uElapse As Long, ByVal lpTimerFunc As LongPtr) As LongPtr
Private Declare PtrSafe Function KillTimer Lib "user32" Alias "KillTimer" _
    (ByVal hwnd As LongPtr, ByVal nIDEvent As LongPtr) As Long

Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
Declare PtrSafe Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" _
    (ByVal hwnd As LongPtr, ByVal nIndex As Long) As LongPtr
Private Declare PtrSafe Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" -
    (ByVal hwnd As LongPtr, ByVal nIndex As Long, ByVal dwNewLong As LongPtr) As LongPtr

Public Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr
Public Declare PtrSafe Function GetDesktopWindow Lib "user32" () As LongPtr
Dạ, em cảm ơn anh ạ
 
Upvote 0
Mót với mẹt. Lỡ trả lời bài phạm quy rồi thấy người ta nhắc thì mắc cở xoá bài.
1591083998795.png
 
Upvote 0
Web KT
Back
Top Bottom