Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1828to1832
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Aktualisieren auf 64 Bit

Aktualisieren auf 64 Bit
19.05.2021 08:02:48
Ansgar
Hallo zusammen,
ich habe lange an einer Exceltabelle gearbeitet. Auch mit viel Hilfe aus diesem Forum. Nun wurde mein Rechner auf 64 bit umgestellt. Ich bekomme natürlich beim Öffnen der Excel Tabelle eine Fehlermeldung. Die Meldung besagt, das die Declare Anweisungen aktualisiert werden müssen und Sie mit dem PtrSafe-Attribut markiert werden müssen. Bei mir verursacht es ein großes Fragezeichen.
Ich bitte höflichst hier um Hilfe.
Hier der Text, der angeblich geändert/angepasst werden muss:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" ( _
ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" ( _
ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hWnd As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SetWindowRgn Lib "user32" ( _
ByVal hWnd As Long, _
ByVal hRgn As Long, _
ByVal bRedraw As Boolean) As Long
Private Declare Function ScreenToClient Lib "user32" ( _
ByVal hWnd As Long, _
lpPoint As POINTAPI) As Long
Private Declare Function GetWindowRect Lib "user32" ( _
ByVal hWnd As Long, _
lpRect As RECT) As Long
Private Declare Function CreateRectRgnIndirect Lib "gdi32" ( _
lpRect As RECT) As Long
Ich hoffe hier kann mir geholfen werden.
Schöne Grüße Ansgar

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Aktualisieren auf 64 Bit
19.05.2021 08:23:56
Nepumuk
Hallo Ansgar,
so:
Code:

[Cc]

Private Declare PtrSafe Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String) As LongPtr Private Declare PtrSafe Function GetWindowLong Lib "user32.dll" Alias "GetWindowLongPtrA" ( _ ByVal hwnd As LongPtr, _ ByVal nIndex As Long) As LongPtr Private Declare PtrSafe Function SetWindowLong Lib "user32.dll" Alias "SetWindowLongPtrA" ( _ ByVal hwnd As LongPtr, _ ByVal nIndex As Long, _ ByVal dwNewLong As LongPtr) As LongPtr Private Declare PtrSafe Function DrawMenuBar Lib "user32.dll" ( _ ByVal hwnd As LongPtr) As Long Private Declare PtrSafe Function SendMessage Lib "user32.dll" Alias "SendMessageA" ( _ ByVal hwnd As LongPtr, _ ByVal wMsg As Long, _ ByVal wParam As LongPtr, _ ByRef lParam As Any) As LongPtr Private Declare PtrSafe Function ReleaseCapture Lib "user32.dll" () As Long Private Declare PtrSafe Function SetWindowRgn Lib "user32.dll" ( _ ByVal hwnd As LongPtr, _ ByVal hRgn As LongPtr, _ ByVal bRedraw As Long) As Long Private Declare PtrSafe Function ScreenToClient Lib "user32.dll" ( _ ByVal hwnd As LongPtr, _ ByRef lpPoint As POINTAPI) As Long Private Declare PtrSafe Function GetWindowRect Lib "user32.dll" ( _ ByVal hwnd As LongPtr, _ ByRef lpRect As RECT) As Long Private Declare PtrSafe Function CreateRectRgnIndirect Lib "gdi32.dll" ( _ ByRef lpRect As RECT) As LongPtr

Damit ist es aber noch nicht getan. Schau auf die Parameter und die Rückgabewerte. Da musst du deine Variablen anpassen.
Beispiel "FindWindow", die Funktion gibt einen LongPtr-Wert zurück. Du musst also die Variable, die den Rückgabewert aufnimmt, als LongPtr deklarieren.
Gruß
Nepumuk
Anzeige

58 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige