Click here to Skip to main content
15,891,976 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Junk characters appearing after writing buffer to file Pin
kool_harsh27-Jul-09 20:00
kool_harsh27-Jul-09 20:00 
QuestionHow to pass an array of objects from C# WebService to a VC++ COM object Pin
sara_venusir24-Jul-09 22:21
sara_venusir24-Jul-09 22:21 
QuestionHow can get occupied by CPU and Memory usage by my application? Pin
Le@rner24-Jul-09 21:27
Le@rner24-Jul-09 21:27 
AnswerRe: How can get occupied by CPU and Memory usage by my application? Pin
Rajesh R Subramanian25-Jul-09 1:11
professionalRajesh R Subramanian25-Jul-09 1:11 
GeneralRe: How can get occupied by CPU and Memory usage by my application? Pin
Le@rner25-Jul-09 1:54
Le@rner25-Jul-09 1:54 
GeneralRe: How can get occupied by CPU and Memory usage by my application? Pin
Rajesh R Subramanian25-Jul-09 2:17
professionalRajesh R Subramanian25-Jul-09 2:17 
GeneralRe: How can get occupied by CPU and Memory usage by my application? Pin
Le@rner26-Jul-09 18:49
Le@rner26-Jul-09 18:49 
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 

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.