author | Michael Krelin <hacker@klever.net> | 2004-11-03 21:50:28 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2004-11-03 21:50:28 (UTC) |
commit | 5f552506513653f08acc6921b8c158489a7ebbbb (patch) (unidiff) | |
tree | 74ab06cf90c488915b87f48e74359554521cbec9 | |
parent | 4435ed85c3acb4df42135e009b133fb8e9d2f09c (diff) | |
download | pumpkin-5f552506513653f08acc6921b8c158489a7ebbbb.zip pumpkin-5f552506513653f08acc6921b8c158489a7ebbbb.tar.gz pumpkin-5f552506513653f08acc6921b8c158489a7ebbbb.tar.bz2 |
Added dialog box in case we can't bind listening socket.
git-svn-id: http://svn.klever.net/kin/pumpkin/trunk@47 fe716a7a-6dde-0310-88d9-d003556173a8
-rw-r--r-- | PumpKINDlg.cpp | 1 | ||||
-rw-r--r-- | pumpkin.rc | 10 | ||||
-rw-r--r-- | resource.h | 1 |
3 files changed, 8 insertions, 4 deletions
diff --git a/PumpKINDlg.cpp b/PumpKINDlg.cpp index 0b3bf41..fc24596 100644 --- a/PumpKINDlg.cpp +++ b/PumpKINDlg.cpp | |||
@@ -318,24 +318,25 @@ HCURSOR CPumpKINDlg::OnQueryDragIcon() | |||
318 | { | 318 | { |
319 | return (HCURSOR) m_hIcon; | 319 | return (HCURSOR) m_hIcon; |
320 | } | 320 | } |
321 | 321 | ||
322 | int CPumpKINDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) | 322 | int CPumpKINDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) |
323 | { | 323 | { |
324 | if (CDialog::OnCreate(lpCreateStruct) == -1) | 324 | if (CDialog::OnCreate(lpCreateStruct) == -1) |
325 | return -1; | 325 | return -1; |
326 | 326 | ||
327 | m_Listener.m_Daddy=this; | 327 | m_Listener.m_Daddy=this; |
328 | if(!m_Listener.Create(m_ListenPort,SOCK_DGRAM)){ | 328 | if(!m_Listener.Create(m_ListenPort,SOCK_DGRAM)){ |
329 | TRACE0("Failed to create socket\n"); | 329 | TRACE0("Failed to create socket\n"); |
330 | AfxMessageBox(IDS_BOX_CANTBIND,MB_OK|MB_ICONEXCLAMATION); | ||
330 | return -1; | 331 | return -1; |
331 | } | 332 | } |
332 | 333 | ||
333 | if(!m_Trayer->Create(NULL,"PumpKIN TrayIcon",WS_CHILD,CRect(0,0,0,0),this,0)){ | 334 | if(!m_Trayer->Create(NULL,"PumpKIN TrayIcon",WS_CHILD,CRect(0,0,0,0),this,0)){ |
334 | TRACE0("Failed to create trayer\n"); | 335 | TRACE0("Failed to create trayer\n"); |
335 | return -1; | 336 | return -1; |
336 | } | 337 | } |
337 | 338 | ||
338 | NOTIFYICONDATA nid; | 339 | NOTIFYICONDATA nid; |
339 | memset(&nid,0,sizeof(nid)); | 340 | memset(&nid,0,sizeof(nid)); |
340 | nid.cbSize=sizeof(nid); | 341 | nid.cbSize=sizeof(nid); |
341 | nid.hWnd=m_Trayer->m_hWnd; | 342 | nid.hWnd=m_Trayer->m_hWnd; |
@@ -73,27 +73,28 @@ IDI_PLAY ICON DISCARDABLE "shared-data/play-icon.ico" | |||
73 | 73 | ||
74 | ///////////////////////////////////////////////////////////////////////////// | 74 | ///////////////////////////////////////////////////////////////////////////// |
75 | // | 75 | // |
76 | // Dialog | 76 | // Dialog |
77 | // | 77 | // |
78 | 78 | ||
79 | IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 74 | 79 | IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 217, 74 |
80 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | 80 | STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU |
81 | CAPTION "About PumpKIN" | 81 | CAPTION "About PumpKIN" |
82 | FONT 8, "MS Sans Serif" | 82 | FONT 8, "MS Sans Serif" |
83 | BEGIN | 83 | BEGIN |
84 | ICON IDR_MAINFRAME,IDC_STATIC,7,17,18,20 | 84 | ICON IDR_MAINFRAME,IDC_STATIC,7,17,18,20 |
85 | LTEXT "PumpKIN, Version 2.5.1-trunk",IDC_STATIC,40,15,119,8,SS_NOPREFIX | 85 | LTEXT "PumpKIN, Version 2.5.1-trunk",IDC_STATIC,40,15,119,8, |
86 | LTEXT "Copyright © 1997-2004 Klever Group",IDC_STATIC,40,30,170, | 86 | SS_NOPREFIX |
87 | 8 | 87 | LTEXT "Copyright © 1997-2004 Klever Group",IDC_STATIC,40,30, |
88 | 170,8 | ||
88 | DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP | 89 | DEFPUSHBUTTON "OK",IDOK,178,7,32,14,WS_GROUP |
89 | PUSHBUTTON "http://www.klever.net/",IDC_KLEVERNET,124,53,86,14 | 90 | PUSHBUTTON "http://www.klever.net/",IDC_KLEVERNET,124,53,86,14 |
90 | END | 91 | END |
91 | 92 | ||
92 | IDD_PUMPKIN_DIALOG DIALOGEX 0, 0, 362, 191 | 93 | IDD_PUMPKIN_DIALOG DIALOGEX 0, 0, 362, 191 |
93 | STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | | 94 | STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | |
94 | WS_SYSMENU | 95 | WS_SYSMENU |
95 | EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW | 96 | EXSTYLE WS_EX_ACCEPTFILES | WS_EX_APPWINDOW |
96 | CAPTION " PumpKIN" | 97 | CAPTION " PumpKIN" |
97 | FONT 8, "MS Sans Serif", 0, 0, 0x1 | 98 | FONT 8, "MS Sans Serif", 0, 0, 0x1 |
98 | BEGIN | 99 | BEGIN |
99 | CONTROL "List1",IDC_CONNECTIONS,"SysListView32",LVS_REPORT | | 100 | CONTROL "List1",IDC_CONNECTIONS,"SysListView32",LVS_REPORT | |
@@ -561,24 +562,25 @@ BEGIN | |||
561 | IDS_DROPFILES_TITLE "Drop Files" | 562 | IDS_DROPFILES_TITLE "Drop Files" |
562 | IDS_NOMULTIPLEDROP_TEXT "You can't drop more than one file here. Only the first one will be accepted" | 563 | IDS_NOMULTIPLEDROP_TEXT "You can't drop more than one file here. Only the first one will be accepted" |
563 | IDS_LOG_REQUESTING "Requesting '%s' from '%s'" | 564 | IDS_LOG_REQUESTING "Requesting '%s' from '%s'" |
564 | IDS_LOG_SENDING "Sending '%s' to '%s'" | 565 | IDS_LOG_SENDING "Sending '%s' to '%s'" |
565 | IDS_WTALKAT "@" | 566 | IDS_WTALKAT "@" |
566 | IDS_OTALXAT " at " | 567 | IDS_OTALXAT " at " |
567 | IDS_TFTP_ERROR_TSIZE "Invalid transfer size" | 568 | IDS_TFTP_ERROR_TSIZE "Invalid transfer size" |
568 | IDS_TFTP_ERROR_BSIZE "Invalid block size" | 569 | IDS_TFTP_ERROR_BSIZE "Invalid block size" |
569 | IDS_TFTP_ERROR_TOUT "Invalid timeout" | 570 | IDS_TFTP_ERROR_TOUT "Invalid timeout" |
570 | IDS_SELECT_TFTPROOT "Select TFTP filesystem root.." | 571 | IDS_SELECT_TFTPROOT "Select TFTP filesystem root.." |
571 | IDS_FILTER_WAV "Sound Files (*.wav)|*.wav||" | 572 | IDS_FILTER_WAV "Sound Files (*.wav)|*.wav||" |
572 | IDS_TITLE_WAV "Select sound.." | 573 | IDS_TITLE_WAV "Select sound.." |
574 | IDS_BOX_CANTBIND "Failed to create listening socket. The port may be in use by another application." | ||
573 | END | 575 | END |
574 | 576 | ||
575 | STRINGTABLE DISCARDABLE | 577 | STRINGTABLE DISCARDABLE |
576 | BEGIN | 578 | BEGIN |
577 | AFX_IDS_APP_TITLE "PUMPKIN" | 579 | AFX_IDS_APP_TITLE "PUMPKIN" |
578 | END | 580 | END |
579 | 581 | ||
580 | #endif // English (U.S.) resources | 582 | #endif // English (U.S.) resources |
581 | ///////////////////////////////////////////////////////////////////////////// | 583 | ///////////////////////////////////////////////////////////////////////////// |
582 | 584 | ||
583 | 585 | ||
584 | 586 | ||
@@ -588,18 +590,18 @@ END | |||
588 | // Generated from the TEXTINCLUDE 3 resource. | 590 | // Generated from the TEXTINCLUDE 3 resource. |
589 | // | 591 | // |
590 | #define _AFX_NO_SPLITTER_RESOURCES | 592 | #define _AFX_NO_SPLITTER_RESOURCES |
591 | #define _AFX_NO_OLE_RESOURCES | 593 | #define _AFX_NO_OLE_RESOURCES |
592 | #define _AFX_NO_TRACKER_RESOURCES | 594 | #define _AFX_NO_TRACKER_RESOURCES |
593 | #define _AFX_NO_PROPERTY_RESOURCES | 595 | #define _AFX_NO_PROPERTY_RESOURCES |
594 | 596 | ||
595 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) | 597 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) |
596 | #ifdef _WIN32 | 598 | #ifdef _WIN32 |
597 | LANGUAGE 9, 1 | 599 | LANGUAGE 9, 1 |
598 | #pragma code_page(1252) | 600 | #pragma code_page(1252) |
599 | #endif | 601 | #endif |
600 | #include "res\pumpkin.rc2" // non-Microsoft Visual C++ edited resources | 602 | #include "res\PumpKIN.rc2" // non-Microsoft Visual C++ edited resources |
601 | #include "afxres.rc" // Standard components | 603 | #include "afxres.rc" // Standard components |
602 | #endif | 604 | #endif |
603 | ///////////////////////////////////////////////////////////////////////////// | 605 | ///////////////////////////////////////////////////////////////////////////// |
604 | #endif // not APSTUDIO_INVOKED | 606 | #endif // not APSTUDIO_INVOKED |
605 | 607 | ||
@@ -69,24 +69,25 @@ | |||
69 | #define IDI_BROWSE 145 | 69 | #define IDI_BROWSE 145 |
70 | #define IDS_LOG_REQUESTING 146 | 70 | #define IDS_LOG_REQUESTING 146 |
71 | #define IDS_LOG_SENDING 147 | 71 | #define IDS_LOG_SENDING 147 |
72 | #define IDS_WTALKAT 148 | 72 | #define IDS_WTALKAT 148 |
73 | #define IDS_OTALXAT 149 | 73 | #define IDS_OTALXAT 149 |
74 | #define IDI_PLAY 149 | 74 | #define IDI_PLAY 149 |
75 | #define IDS_TFTP_ERROR_TSIZE 150 | 75 | #define IDS_TFTP_ERROR_TSIZE 150 |
76 | #define IDS_TFTP_ERROR_BSIZE 151 | 76 | #define IDS_TFTP_ERROR_BSIZE 151 |
77 | #define IDS_TFTP_ERROR_TOUT 152 | 77 | #define IDS_TFTP_ERROR_TOUT 152 |
78 | #define IDS_SELECT_TFTPROOT 153 | 78 | #define IDS_SELECT_TFTPROOT 153 |
79 | #define IDS_FILTER_WAV 154 | 79 | #define IDS_FILTER_WAV 154 |
80 | #define IDS_TITLE_WAV 155 | 80 | #define IDS_TITLE_WAV 155 |
81 | #define IDS_BOX_CANTBIND 156 | ||
81 | #define IDC_KLEVERNET 1000 | 82 | #define IDC_KLEVERNET 1000 |
82 | #define IDC_CONNECTIONS 1001 | 83 | #define IDC_CONNECTIONS 1001 |
83 | #define IDC_LOG 1003 | 84 | #define IDC_LOG 1003 |
84 | #define IDC_GET 1004 | 85 | #define IDC_GET 1004 |
85 | #define IDC_PUT 1005 | 86 | #define IDC_PUT 1005 |
86 | #define IDC_ABORT 1006 | 87 | #define IDC_ABORT 1006 |
87 | #define IDC_EXIT 1007 | 88 | #define IDC_EXIT 1007 |
88 | #define IDC_TFTPROOT 1008 | 89 | #define IDC_TFTPROOT 1008 |
89 | #define IDC_TFTPSUBDIRS 1009 | 90 | #define IDC_TFTPSUBDIRS 1009 |
90 | #define IDC_RRQ_GIVEALL 1010 | 91 | #define IDC_RRQ_GIVEALL 1010 |
91 | #define IDC_RRQ_ALWAYSCONFIRM 1011 | 92 | #define IDC_RRQ_ALWAYSCONFIRM 1011 |
92 | #define IDC_RRQ_DENYALL 1012 | 93 | #define IDC_RRQ_DENYALL 1012 |