Click here to Skip to main content
15,884,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionread(fd,buf,1) Pin
ffrankcp24-Jul-09 20:56
ffrankcp24-Jul-09 20:56 
AnswerRe: read(fd,buf,1) Pin
killabyte24-Jul-09 21:20
killabyte24-Jul-09 21:20 
GeneralRe: read(fd,buf,1) Pin
ffrankcp24-Jul-09 21:38
ffrankcp24-Jul-09 21:38 
GeneralRe: read(fd,buf,1) [modified] Pin
killabyte24-Jul-09 21:46
killabyte24-Jul-09 21:46 
AnswerRe: read(fd,buf,1) Pin
killabyte24-Jul-09 22:17
killabyte24-Jul-09 22:17 
QuestionFindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Still learning how to code24-Jul-09 20:50
Still learning how to code24-Jul-09 20:50 
AnswerRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
killabyte24-Jul-09 21:54
killabyte24-Jul-09 21:54 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Still learning how to code24-Jul-09 22:05
Still learning how to code24-Jul-09 22:05 
Here is the code in my worker thread, as requested:-

UINT WaitNewScheduleThread(LPVOID Param)          //20090723
{
     CWinThread* pThread = AfxGetThread();
     int iID = pThread->m_nThreadID;
     CString szLogMsg;
     szLogMsg.Format("\n>>> Worker thread ID = 0x%X\n",iID);
     OutputDebugString(szLogMsg);


     CMCManagerBEDlg* pDlg = (CMCManagerBEDlg*)Param;
     CMCManagerBEApp* pApp;
     pApp = (CMCManagerBEApp*)AfxGetApp();
    
     HANDLE hCN;
     CString szPathName;
     szPathName.Format("Z:\\WinDVR");
     //szPathName.Format("C:\\Dell");

     // Set up array of two handles
     HANDLE hExitEvent;
     hExitEvent = pApp->m_hExitEvent;
     HANDLE handles[2];
     int iRetCode;

     DWORD dwRC;
            DWORD         err;

     do
     {
          hCN = FindFirstChangeNotification(szPathName,FALSE,FILE_NOTIFY_CHANGE_FILE_NAME);
          if(hCN == INVALID_HANDLE_VALUE)
               err = GetLastError();

          handles[0] = hCN;
          handles[1] = pApp->m_hExitEvent;

          dwRC = WaitForMultipleObjects(2,handles,FALSE,INFINITE);

          if(dwRC == WAIT_OBJECT_0)
          {
               szLogMsg.Format("Found new file on %s",szPathName);
               g_pLogFile->Add(szLogMsg);
               OutputDebugString(szLogMsg);

               if(g_pDlg->m_bPermitSchedUpdate)
                    g_pDlg->ProcessNewSchedule();
               else
                    g_pDlg->m_bNewSchedAvailable = TRUE;

               iRetCode = 0;
          }
          if(dwRC == WAIT_OBJECT_0 + 1)
          {
               szLogMsg.Format(">>> New recording schedule thread terminated\n");
               OutputDebugString(szLogMsg);
               g_pLogFile->Add(szLogMsg);

               iRetCode = 9;
               break;
          }
          if(dwRC == WAIT_FAILED)
          {
               szLogMsg.Format(">>> Wait failed");
               OutputDebugString(szLogMsg);

          }
     }
     while(TRUE);

     return iRetCode;
}

Doug

GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
killabyte24-Jul-09 22:22
killabyte24-Jul-09 22:22 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Still learning how to code24-Jul-09 22:32
Still learning how to code24-Jul-09 22:32 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
killabyte24-Jul-09 22:45
killabyte24-Jul-09 22:45 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Still learning how to code24-Jul-09 22:55
Still learning how to code24-Jul-09 22:55 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
killabyte24-Jul-09 22:58
killabyte24-Jul-09 22:58 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Still learning how to code24-Jul-09 23:08
Still learning how to code24-Jul-09 23:08 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
killabyte24-Jul-09 23:24
killabyte24-Jul-09 23:24 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Still learning how to code24-Jul-09 23:40
Still learning how to code24-Jul-09 23:40 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Frank Seidler24-Jul-09 23:06
Frank Seidler24-Jul-09 23:06 
GeneralRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Still learning how to code24-Jul-09 23:10
Still learning how to code24-Jul-09 23:10 
AnswerRe: FindFirstChangeNotification() results in "The network BIOS command limit has been reached." Pin
Rozis25-Jul-09 4:38
Rozis25-Jul-09 4:38 
QuestionGEtting Error when assigning struct array to an another array Pin
resolvequestion24-Jul-09 12:08
resolvequestion24-Jul-09 12:08 
AnswerRe: GEtting Error when assigning struct array to an another array Pin
Kelly Herald24-Jul-09 13:21
Kelly Herald24-Jul-09 13:21 
QuestionCounting items in a file with a C++ program Pin
Member 330122924-Jul-09 10:05
Member 330122924-Jul-09 10:05 
AnswerRe: Counting items in a file with a C++ program Pin
Rozis24-Jul-09 13:15
Rozis24-Jul-09 13:15 
AnswerRe: Counting items in a file with a C++ program Pin
Joe Woodbury24-Jul-09 14:40
professionalJoe Woodbury24-Jul-09 14:40 
AnswerRe: Counting items in a file with a C++ program Pin
«_Superman_»24-Jul-09 17:37
professional«_Superman_»24-Jul-09 17:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.