Showing
2 changed files
with
11 additions
and
7 deletions
| ... | ... | @@ -477,8 +477,11 @@ BOOL SettingsDlgInit( HWND hDlg ) |
| 477 | 477 | // |
| 478 | 478 | // fill port combo box and make initial selection |
| 479 | 479 | // |
| 480 | - for (wCount = 0; wCount < wMaxCOM; wCount++) { | |
| 481 | - wsprintf( szBuffer, "%s%d", (LPSTR) szTemp, wCount + 1 ) ; | |
| 480 | + for (wCount = 0; wCount < 255; wCount++) | |
| 481 | + { | |
| 482 | + if (TTYInfo.unOpenedPortAry[wCount] == 0) | |
| 483 | + continue;; | |
| 484 | + wsprintf( szBuffer, "%s%d", (LPSTR) szTemp, TTYInfo.unOpenedPortAry[wCount] ) ; | |
| 482 | 485 | SendDlgItemMessage( hDlg, IDC_PORTCOMBO, CB_ADDSTRING, 0, |
| 483 | 486 | (LPARAM) (LPSTR) szBuffer ) ; |
| 484 | 487 | } |
| ... | ... | @@ -671,11 +674,6 @@ BOOL CALLBACK ToolbarProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 671 | 674 | { |
| 672 | 675 | case IDC_BUTTON2_SEC_BINFILE: |
| 673 | 676 | { |
| 674 | - if (TTYInfo.DownloadReday == FALSE) | |
| 675 | - { | |
| 676 | - MessageBox(ghwndMain, "请合上夹具", "提示!", MB_OK); | |
| 677 | - return; | |
| 678 | - } | |
| 679 | 677 | if (strlen(TTYInfo.szFileName) == 0) |
| 680 | 678 | { |
| 681 | 679 | char * szFilter = "Text Files\0*.*\0"; |
| ... | ... | @@ -694,6 +692,11 @@ BOOL CALLBACK ToolbarProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| 694 | 692 | SetWindowText(GetDlgItem(hWndDlg, IDC_BUTTON2_SEC_BINFILE), "下载软件"); |
| 695 | 693 | |
| 696 | 694 | } |
| 695 | + if (TTYInfo.DownloadReday == FALSE) | |
| 696 | + { | |
| 697 | + MessageBox(ghwndMain, "请合上夹具", "提示!", MB_OK); | |
| 698 | + return; | |
| 699 | + } | |
| 697 | 700 | |
| 698 | 701 | |
| 699 | 702 | if (TRUE) | ... | ... |
Please
register
or
login
to post a comment