[PATCH] oledb32: Add Next button logic

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue Feb 18 02:50:25 CST 2020


Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
 dlls/oledb32/dslocator.c | 19 +++++++++++++++++--
 dlls/oledb32/resource.h  |  2 ++
 dlls/oledb32/version.rc  |  3 +++
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/dlls/oledb32/dslocator.c b/dlls/oledb32/dslocator.c
index 11ee76cddb..4835830cf3 100644
--- a/dlls/oledb32/dslocator.c
+++ b/dlls/oledb32/dslocator.c
@@ -278,8 +278,23 @@ static LRESULT CALLBACK data_link_properties_dlg_proc(HWND hwnd, UINT msg, WPARA
         {
             if (LOWORD(wp) == IDC_BTN_NEXT)
             {
-                /* TODO: Implement Connection dialog */
-                MessageBoxA(hwnd, "Not implemented yet.", "Error", MB_OK | MB_ICONEXCLAMATION);
+                HWND lv = GetDlgItem(hwnd, IDC_LST_CONNECTIONS);
+                if (SendMessageW(lv, LVM_GETSELECTEDCOUNT, 0, 0))
+                {
+                    /*
+                     * FIXME: This needs to replace the connection page based off the selection.
+                     *   We only care about the ODBC for now which is the default.
+                     */
+                    SendMessageW(GetParent(hwnd), PSM_SETCURSEL, 1, 0);
+                }
+                else
+                {
+                    WCHAR title[256], msg[256];
+
+                    LoadStringW(instance, IDS_PROVIDER_TITLE, title, ARRAY_SIZE(title));
+                    LoadStringW(instance, IDS_PROVIDER_ERROR, msg, ARRAY_SIZE(msg));
+                    MessageBoxW(hwnd, msg, title, MB_OK | MB_ICONEXCLAMATION);
+                }
             }
             break;
         }
diff --git a/dlls/oledb32/resource.h b/dlls/oledb32/resource.h
index 3760a38487..dfedb34a54 100644
--- a/dlls/oledb32/resource.h
+++ b/dlls/oledb32/resource.h
@@ -19,6 +19,8 @@
 #define IDD_PROVIDER        1000
 #define IDC_BTN_NEXT        1001
 #define IDC_LST_CONNECTIONS 1002
+#define IDS_PROVIDER_TITLE  1003
+#define IDS_PROVIDER_ERROR  1004
 
 #define IDS_PROPSHEET_TITLE 2000
 #define IDS_COL_PROVIDER    2001
diff --git a/dlls/oledb32/version.rc b/dlls/oledb32/version.rc
index 97714086eb..080e444eb7 100644
--- a/dlls/oledb32/version.rc
+++ b/dlls/oledb32/version.rc
@@ -45,6 +45,9 @@ STRINGTABLE
     IDS_PERM_SHAREDENYWRITE "Share Deny Write"
     IDS_PERM_SHAREEXCLUSIVE "Share Exclusive"
     IDS_PERM_WRITE          "Write"
+
+    IDS_PROVIDER_TITLE      "Data Link Error"
+    IDS_PROVIDER_ERROR      "Please select a provider."
 }
 
 IDD_PROVIDER DIALOG 0, 0, 227, 225
-- 
2.25.0




More information about the wine-devel mailing list