Bonjour à toutes et à tous,
Je viens solliciter l'aide d'expert sur un problème de compatibilité 32 et 64 bits. Après plusieurs tests je n'arrive malheureusement pas à faire fonctionner mon fichier dans les 2 versions.
Ci-dessous mes 3 déclarations de fonctions sur 3 modules, je ne sais pas laquelle bloque, je vous remercie sincèrement de votre aide.
1er :
#If Win64 Then
Public Declare PtrSafe Function IsWindowVisible& Lib "user32" (ByVal hwnd As LongPtr)
Public Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
#Else
Public Declare Function IsWindowVisible& Lib "user32" (ByVal hwnd As Long)
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
#End If
2ème :
#If Win64 Then
Declare PtrSafe Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
#Else
Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
#End If
3ème :
Option Explicit
#If Win64 Then
Private Declare PtrSafe Function knlOpen Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As LongPtr) As LongPtr
Private Declare PtrSafe Function knlClose Lib "kernel32" Alias "_lclose" (ByVal hFile As LongPtr) As LongPtr
#Else
Private Declare Function knlOpen Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Long) As Long
Private Declare Function knlClose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long
#End If
Je viens solliciter l'aide d'expert sur un problème de compatibilité 32 et 64 bits. Après plusieurs tests je n'arrive malheureusement pas à faire fonctionner mon fichier dans les 2 versions.
Ci-dessous mes 3 déclarations de fonctions sur 3 modules, je ne sais pas laquelle bloque, je vous remercie sincèrement de votre aide.
1er :
#If Win64 Then
Public Declare PtrSafe Function IsWindowVisible& Lib "user32" (ByVal hwnd As LongPtr)
Public Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As LongPtr
#Else
Public Declare Function IsWindowVisible& Lib "user32" (ByVal hwnd As Long)
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
#End If
2ème :
#If Win64 Then
Declare PtrSafe Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
#Else
Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
#End If
3ème :
Option Explicit
#If Win64 Then
Private Declare PtrSafe Function knlOpen Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As LongPtr) As LongPtr
Private Declare PtrSafe Function knlClose Lib "kernel32" Alias "_lclose" (ByVal hFile As LongPtr) As LongPtr
#Else
Private Declare Function knlOpen Lib "kernel32" Alias "_lopen" (ByVal lpPathName As String, ByVal iReadWrite As Long) As Long
Private Declare Function knlClose Lib "kernel32" Alias "_lclose" (ByVal hFile As Long) As Long
#End If