Skip to content

Commit

Permalink
ODBC-385 Fixes in the setup dilog to comply updated docs
Browse files Browse the repository at this point in the history
Dialog used SERVER for saving pipe name and in connection test.
  • Loading branch information
lawrinn committed Mar 8, 2023
1 parent 9b1fa2d commit 855667c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion dsn/odbc_dsn.c
Expand Up @@ -73,6 +73,7 @@ MADB_DsnMap DsnMap[] = {
{&DsnKeys[5], 1, rbPipe, 0, 0},
{&DsnKeys[6], 1, rbTCP, 0, 0},
{&DsnKeys[7], 1, txtServerName, 128, 0},
{&DsnKeys[29], 1, txtSocket, 128, 0},
{&DsnKeys[8], 1, txtUserName, 64, 0},
{&DsnKeys[9], 1, txtPassword, 64, 0},
{&DsnKeys[10], 1, cbDatabase, 0, 0},
Expand Down Expand Up @@ -199,6 +200,8 @@ my_bool SetDialogFields()
if (Val && OptionsMap[i].Item == rbPipe)
{
SendMessage(GetDlgItem(hwndTab[OptionsMap[i].Page], lblServerName), WM_SETTEXT, 0, (LPARAM)"Named pipe:");
ShowWindow(GetDlgItem(hwndTab[OptionsMap[i].Page], txtServerName), SW_HIDE);
ShowWindow(GetDlgItem(hwndTab[OptionsMap[i].Page], txtSocket), SW_SHOW);
ShowWindow(GetDlgItem(hwndTab[OptionsMap[i].Page], lblPort), SW_HIDE);
ShowWindow(GetDlgItem(hwndTab[OptionsMap[i].Page], txtPort), SW_HIDE);
}
Expand Down Expand Up @@ -776,9 +779,12 @@ INT_PTR CALLBACK DialogDSNProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
(LOWORD(wParam) == rbTCP) ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(hwndTab[CurrentPage], txtPort),
(LOWORD(wParam) == rbTCP) ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(hwndTab[CurrentPage], txtServerName),
(LOWORD(wParam) == rbTCP) ? SW_SHOW : SW_HIDE);
ShowWindow(GetDlgItem(hwndTab[CurrentPage], txtSocket),
(LOWORD(wParam) == rbTCP) ? SW_HIDE : SW_SHOW);
}
return TRUE;

}
break;
}
Expand Down
1 change: 1 addition & 0 deletions dsn/odbc_dsn.rc
Expand Up @@ -112,6 +112,7 @@ BEGIN
LTEXT "Database:",IDC_STATIC,20,121,34,8,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
CONTROL "TCP/IP",rbTCP,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,7,21,38,10,WS_EX_TRANSPARENT
CONTROL "Named Pipe",rbPipe,"Button",BS_AUTORADIOBUTTON,7,33,53,10,WS_EX_TRANSPARENT
EDITTEXT txtSocket,139,18,141,14,ES_AUTOHSCROLL | NOT WS_VISIBLE
EDITTEXT txtServerName,139,18,141,14,ES_AUTOHSCROLL
EDITTEXT txtPort,140,34,40,14,ES_AUTOHSCROLL
LTEXT "Port:",lblPort,86,35,49,11,0,WS_EX_TRANSPARENT | WS_EX_RIGHT
Expand Down
2 changes: 1 addition & 1 deletion dsn/resource.h
Expand Up @@ -31,13 +31,13 @@
#define rbPipe 1020
#define IDC_CHECK4 1021
#define txtServerName 1022
#define txtSocket 1031
#define IDC_CHECK5 1023
#define lblServerName 1024
#define txtPort 1026
#define lblPort 1028
#define IDC_CHECK8 1029
#define IDC_CHECK9 1030
#define txtServer 1031
#define txtUserName 1032
#define IDC_EDIT4 1033
#define txtPassword 1034
Expand Down

0 comments on commit 855667c

Please sign in to comment.