Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1636to1640
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

XL64-Bit Problem mit CreateWindowEx

XL64-Bit Problem mit CreateWindowEx
31.07.2018 17:33:12
Reinhard
Ich verwende CreateWindowEx um eine Progressbar zu zeichnen.
Das funktioniert super in XL32-Bit aber nicht in XL64-Bit.
mlWnd = CreateWindowEx(0&, "msctls_progress32", sHinw, _
mlWS_VISIBLE Or mlWS_POPUP Or mlWS_BORDER Or mlWS_CAPTION, _
lX, lY, lWidth, lHeight, _
lWnd, 0&, Application.hInstance, 0&)
Hat jemdand eine Idee, warum dies nicht in XL64-Bit läuft.
Hilft da vielleicht die Funktion InitCommonControlsEx Lib "comctl32.dll"...
Liegt das Problem vielleicht an der comctl32.dll? Ist ja keine .ocx!
Vielleicht hat jemand solch eine Lösung schon mal unter XL64-Bit ans Laufen gebracht.
Danke,
Reinhard

4
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: XL64-Bit Problem mit CreateWindowEx
31.07.2018 17:47:54
onur
Versuch mal mit:
Declare PtrSafe Function CreateWindowEx Lib "user32.dll" _
AW: XL64-Bit Problem mit CreateWindowEx
01.08.2018 07:02:45
Reinhard
Habs gefunden! Muss heissen Application.HinstancePtr anstelle von Application.hInstance.
mlWnd = CreateWindowEx(0&, "msctls_progress32", sHinw, _
mlWS_VISIBLE Or mlWS_POPUP Or mlWS_BORDER Or mlWS_CAPTION, _
lX, lY, lWidth, lHeight, _
lWnd, 0&, Application.HinstancePtr, 0&)

AW: XL64-Bit Problem mit CreateWindowEx
31.07.2018 17:59:03
Nepumuk
Hallo Reinhard,
sieht deine Importfunktion so aus?
Private Declare PtrSafe Function CreateWindowEx Lib "user32.dll" Alias "CreateWindowExA" ( _
    ByVal dwExStyle As Long, _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String, _
    ByVal dwStyle As Long, _
    ByVal x As Long, _
    ByVal y As Long, _
    ByVal nWidth As Long, _
    ByVal nHeight As Long, _
    ByVal hWndParent As LongPtr, _
    ByVal hMenu As LongPtr, _
    ByVal hInstance As LongPtr, _
    ByRef lpParam As Any) As LongPtr

Gruß
Nepumuk
Anzeige
AW: XL64-Bit Problem mit CreateWindowEx
31.07.2018 22:22:24
Reinhard

#If VBA7 Then
Private Declare PtrSafe Function CreateWindowEx Lib "user32" Alias "CreateWindowExW" ( _
ByVal dwExStyle As Long, ByVal lpClassName As LongPtr, ByVal lpWindowName As LongPtr, ...
Private mlWnd As LongPtr
Private Const msPROGRESS_CLASS As String = "msctls_progress32"      '\Progess bar class name
Public Sub Show(ByVal lMin As Long, ...
'\ProgressBar erzeugen
mlWnd = CreateWindowEx(0&, StrPtr(msPROGRESS_CLASS), StrPtr(sHinw), _
mlWS_VISIBLE Or mlWS_POPUP Or mlWS_BORDER Or mlWS_CAPTION, _
lX, lY, lWidth, lHeight, _
lWnd, 0&, Application.hInstance, 0&)
In XL32-Bit funktioniert es ohne Probleme nur in XL64-Bit wird kein Fenster gezeigt.
Hab noch als msPROGRESS_CLASS = "STATIC" probiert mit dem gleichen Ergebnis -> nichts wird gezeigt.
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige