-
March 1st, 2004, 06:03 AM
#31
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?
-
March 2nd, 2004, 03:31 AM
#32
Time out works when debugging in release mode
I don't really know what to do
-
March 2nd, 2004, 04:04 AM
#33
Does time out work if you run the same release exe outside Visual Studio?
-
March 2nd, 2004, 04:27 AM
#34
Originally posted by astanley
Does time out work if you run the same release exe outside Visual Studio?
No it doesn't!
-
March 2nd, 2004, 04:59 AM
#35
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?
-
March 2nd, 2004, 05:11 AM
#36
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
-
March 2nd, 2004, 10:40 AM
#37
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.
-
May 30th, 2004, 04:52 AM
#38
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,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|