CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 3 of 3 FirstFirst 123
Results 31 to 38 of 38
  1. #31
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815
    Originally posted by mfc_oracle
    I've debugged it in release mode as well; all variables have proper values!
    However, by debugging the release build, you should be able to see where the problem is. What exactly is going on in the debug build which does not happen in the release build?

  2. #32
    Join Date
    Oct 2003
    Location
    Iran
    Posts
    79
    Time out works when debugging in release mode
    I don't really know what to do

  3. #33
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    Does time out work if you run the same release exe outside Visual Studio?

  4. #34
    Join Date
    Oct 2003
    Location
    Iran
    Posts
    79
    Originally posted by astanley
    Does time out work if you run the same release exe outside Visual Studio?
    No it doesn't!

  5. #35
    Join Date
    Sep 2002
    Location
    14° 39'19.65"N / 121° 1'44.34"E
    Posts
    9,815
    It is still unclear what doesn't work. Is OnIdle() not called? Is the timer proc not being called?
    Besides that, what exactly do you mean by "release mode" and "debug mode"? These modes don't exist. There are debug builds and release builds, and you can run an app directly or in the debugger. But "debug mode" is an unclear term - does it mean a debug build, or running the app in the debugger?

  6. #36
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    Bear in mind gstercken comments.

    I would add this. Run the release build exe (which should contain the debug info as per our instructions yesterday) outside of Visual Studio.

    Once it is running, go to Windows Task Manager, Processes tab, right click the name of the executable, and select Debug. This will bring up the JIT debugger, which will enable you to debug the process. As you have built it with debug symbols, you should have access to source and run time info.

    You can set Visual Studio to be the JIT debugger by setting the registry entry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger to

    "C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\msdev.exe" -p %ld -e %ld

  7. #37
    Join Date
    Mar 2004
    Posts
    7
    The way you are going about this is wrong - in order to do what you are trying to do, you need to use a Keyboard and Mouse hook function to detect when the appropriate idle time has passed.

    If you are still stuck, let me know, I'll e-mail you code that works already.
    Last edited by smg123; March 2nd, 2004 at 11:16 AM.

  8. #38
    Join Date
    Oct 2003
    Location
    Iran
    Posts
    79
    I have modified my code so that when the time out expires it closes any dialog then closes the whole application:
    if (!bInTimer && nIDEvent == m_nHookTimer)
    {
    bInTimer = TRUE;
    if (theApp.m_nTimeOutCount == theApp.m_lSecProjectTimeOut)
    {
    if (++theApp.m_nTimeOutMinsElapsed >= theApp.m_nTimeOutMins)
    {
    //not currently processing previous timer message
    CWnd* pActiveWnd = GetActiveWindow ();
    if( pActiveWnd != NULL && pActiveWnd ->m_hWnd != NULL
    && pActiveWnd != this )
    {
    CDialog* pDlg = (CDialog*)pActiveWnd;
    pDlg ->SendMessage(WM_CLOSE);
    }
    }
    theApp.m_lSecProjectTimeOut = 1;
    }//if(GetActiveWindow () != this )
    else
    {
    theApp.OnLogoff();
    }

    But the problem is that when another page like word or MSoutlook is opened and the time out expires the application is closed while the dialog (its child window) is open and if the user clicks on it, it throws an exception. That's why in this situation the active window is the word or ... that is opened not that dialog.
    what would you suggest to solve this problem?

    Thanks & regards,

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured