OSDN Git Service

接続処理中のマウス描画処理を回収
authorunknown <qwerty2501@users.sourceforge.jp>
Tue, 14 Feb 2012 01:24:04 +0000 (10:24 +0900)
committerunknown <qwerty2501@users.sourceforge.jp>
Tue, 14 Feb 2012 01:24:04 +0000 (10:24 +0900)
nlite.suo
nlite/nlite.h
nlite/nlite_commentWrite.h
nlite/nlite_mainframe.cpp
nlite/nlite_mainframe.h

index 8d82c60..5a58a86 100644 (file)
Binary files a/nlite.suo and b/nlite.suo differ
index 465f12b..293b314 100644 (file)
@@ -22,7 +22,7 @@ namespace nlite{
                UM_CLICK_CHATNO,
                UM_CLICK_USERNAME,
                UM_UPDATEUI,
-
+               UM_UNLOCK_LVNOBUFFER
        };
 
        
index f50c5a0..316965f 100644 (file)
@@ -114,6 +114,7 @@ namespace nlite{
                CFont timeFont;                                                                                 //\8co\89ß\8e\9e\8aÔ\95\\8e¦\97p\83t\83H\83\93\83g
                COLORREF editBkColor;                                                                   //\83G\83f\83B\83b\83g\82Ì\94w\8ci\90F
                CBrush editBkBrush;                                                                             //\83G\83f\83B\83b\83g\82Ì\94w\8ci\83u\83\89\83V
+               
 
                //\83R\83\93\83g\83\8d\81[\83\8bID
                enum CONTROLID{
index 187fad2..f2b749c 100644 (file)
@@ -271,6 +271,11 @@ VOID CNliteMainFrame::OnViewPreference(UINT uNotifyCode,int nID,HWND hWndCtl){
        return;
 }
 
+LRESULT CNliteMainFrame::OnUnlockLvNoBuffer(UINT uMsg,WPARAM wParam,LPARAM lParam){
+       this->lvNoBufCS.Unlock();
+       return 0;
+}
+
 //\83N\83b\83L\81[\82Ì\90Ý\92è
 VOID CNliteMainFrame::OnCookie(UINT uNotifyCode,int nID,HWND hWndCtl){
        nliteProperty.CookieSetting();
@@ -292,27 +297,14 @@ VOID CNliteMainFrame::OnCookie(UINT uNotifyCode,int nID,HWND hWndCtl){
 VOID CNliteMainFrame::ConnectingThread(LPVOID userData){
 
        auto &self = *(CNliteMainFrame*)userData;
-       self.lvNoCombo.GetEditCtrl().SetReadOnly(TRUE);
-       self.subLiveNoComboBox.untilConnectingFlag = TRUE;
-       self.EnableWindow(FALSE);
-       Sleep(3000);
-       self.subLiveNoComboBox.AgreeInputLvNo();
-       _endthread();
-       return;
-}
-
-
-BOOL CNliteMainFrame::ConnectNicoLive(LPCTSTR liveNo){
-       
-
-       _beginthread(CNliteMainFrame::ConnectingThread,0,this);
-       BOOL rslt = FALSE;
+       CString lvNoString = self.lvNoBuffer;
+       self.SendMessage(UM_UNLOCK_LVNOBUFFER,(WPARAM)0,(LPARAM)0);
        try {
-               nicoLiveStream.DisConnect();
-               commentView.OnConnect();
+               self.nicoLiveStream.DisConnect();
+               self.commentView.OnConnect();
                
        
-               NLIB_RESULT code = nicoLiveStream.Connect(nicoVideoAuth,liveNo,LiveCallBack,&userData);
+               NLIB_RESULT code = self.nicoLiveStream.Connect(self.nicoVideoAuth,lvNoString,LiveCallBack,&self.userData);
 
                //\83G\83\89\81[\83R\81[\83h\8f\88\97\9d
                switch(code){
@@ -320,7 +312,7 @@ BOOL CNliteMainFrame::ConnectNicoLive(LPCTSTR liveNo){
                        //\90³\8fí\8fI\97¹
                case NLIB_ERR_OK:
 
-                       rslt = TRUE;
+                       
                        goto end;
 
                        //\91z\92è\82³\82ê\82½\83G\83\89\81[\83R\81[\83h
@@ -353,7 +345,7 @@ BOOL CNliteMainFrame::ConnectNicoLive(LPCTSTR liveNo){
 
 
                        
-                       ::MessageBox(*this,NLIB_GetErrorMessage(code),TEXT("\95ú\91\97\90Ú\91±\83G\83\89\81["),MB_ICONERROR | MB_OK);
+                       ::MessageBox(self,NLIB_GetErrorMessage(code),TEXT("\95ú\91\97\90Ú\91±\83G\83\89\81["),MB_ICONERROR | MB_OK);
 
                        break;
 
@@ -367,8 +359,8 @@ BOOL CNliteMainFrame::ConnectNicoLive(LPCTSTR liveNo){
                        break;
 
                }
-               this->subLiveNoComboBox.AgreeInputLvNo();
-               rslt = FALSE;
+               self.subLiveNoComboBox.AgreeInputLvNo();
+               
 
        } catch(nlib::Exception &e){
 
@@ -376,9 +368,26 @@ BOOL CNliteMainFrame::ConnectNicoLive(LPCTSTR liveNo){
 
        }
 end:
+       
+       self.subLiveNoComboBox.AgreeInputLvNo();
+       _endthread();
+       return;
+}
+
 
+BOOL CNliteMainFrame::ConnectNicoLive(LPCTSTR liveNo){
+       
+       lvNoCombo.GetEditCtrl().SetReadOnly(TRUE);
+       subLiveNoComboBox.untilConnectingFlag = TRUE;
+       EnableWindow(FALSE);
+       lvNoBufCS.Lock();
+       this->lvNoBuffer = liveNo;
+       _beginthread(CNliteMainFrame::ConnectingThread,0,this);
 
-       return rslt;
+       
+
+
+       return TRUE;
 
 }
 
index 2db1fbf..e597e50 100644 (file)
@@ -187,6 +187,8 @@ namespace nlite{
                CProgressBarCtrl  m_progresBar;                         //\83v\83\8d\83O\83\8c\83X\83o\81[
                CListenerSettingWindow listenerSettingWindow;   //\83\8a\83X\83i\81[\90Ý\92è\83E\83B\83\93\83h\83E
                
+               CComAutoCriticalSection lvNoBufCS;                                              //\90\95ú\91\97\94Ô\8d\86\83N\83\8a\83e\83B\83J\83\8b\83Z\83N\83V\83\87\83\93
+               CString lvNoBuffer;                                                             //\90\95ú\91\97\94Ô\8d\86\83o\83b\83t\83@
        private:
                // \83\81\83b\83Z\81[\83W\83t\83B\83\8b\83^\8f\88\97\9d
                virtual BOOL PreTranslateMessage(MSG* pMsg);
@@ -226,6 +228,7 @@ namespace nlite{
                        MESSAGE_HANDLER(WM_SETCURSOR,OnSetCursor)
                        MESSAGE_HANDLER_EX(UM_CLICK_CHATNO,OnClickChatNo)
                        MESSAGE_HANDLER_EX(UM_UPDATEUI,OnUpDateUI)
+                       MESSAGE_HANDLER_EX(UM_UNLOCK_LVNOBUFFER,OnUnlockLvNoBuffer)
                        MESSAGE_HANDLER_EX(UM_CLICK_USERNAME,OnClickUserName)
                        COMMAND_ID_HANDLER_EX(IDM_EXIT, OnMenuExit)
                        COMMAND_ID_HANDLER_EX(IDM_ABOUT,OnMenuAbount)
@@ -341,6 +344,12 @@ namespace nlite{
                VOID OnViewPreference(UINT uNotifyCode,int nID,HWND hWndCtl);
 
                ///
+               ///\90\95ú\91\97\94Ô\8d\86\83o\83b\83t\83@\82Ì\83\8d\83b\83N\82ð\89ð\8f\9c
+               ///
+               LRESULT OnUnlockLvNoBuffer(UINT uMsg,WPARAM wParam,LPARAM lParam);
+
+
+               ///
                ///CNicoLiveStream\82Ì\83R\81[\83\8b\83o\83b\83N\97p\8aÖ\90\94
                ///
                static NLIB_RESULT LiveCallBack(NICOLIVE_EVENT eventType,NicoLiveStream_P pNicoLiveStream,LPVOID option,NICOLIVE_PARAM param1,NICOLIVE_PARAM param2);