-
July 26th, 2000, 09:18 AM
#1
SetTimer
Hi,
I'm getting an assertion error with my Timer. When I use the debugger, it didn't go into the timer function ... it crashed at SetTimer. Just wondering what's wrong with my statement:
int timeInBetween=1000/20;
SetTimer(1,timeInBetween,NULL);
Does the first parameter of SetTimer matters ... it's the nIDEvent? I used 1 ... could this cause the error?
Thanks,
Alex
-
July 26th, 2000, 09:24 AM
#2
Re: SetTimer
Are you using the CWnd version of SetTimer? What does the assertion say? I don't think using the number one should be a problem though, unless you already started a timer with that ID.
-
July 26th, 2000, 09:32 AM
#3
Re: SetTimer
I am using it in a class that is inherited from CView. i.e.
class fcClassublic CView
The assertion didn't say much:
"Debug Assertion Failed!
Program: ... exe
File: afxwin2.inl
Line: 168
..."
I did include Afxwin.h as said in MSDN. So, I'm clueless.
Thanks,
Alex
-
July 26th, 2000, 09:40 AM
#4
Re: SetTimer
Ok, what I did was actually dig up that afxwin2.inl file (you could have also stepped through the procedure and came to the same line of code) and went to the specified line of code. It is asserting because your view hasn't become an actual window yet. If you're setting the timer in the constructor or something, this will happen. If you need a timer for each view, set it in the OnInitialUpdate function.
-
February 28th, 2019, 12:28 PM
#5
Re: SetTimer
Hi Michael, I have similar issue and you explained it very well. Thank you.
I am using visual studio 2017. How to dig up and step into afxwin2.inl file?
-
February 28th, 2019, 01:19 PM
#6
Re: SetTimer
Doesn't F11 work?
Or you could open it in VS and set the break point somewhere you'd like to "dig up".
Victor Nijegorodov
-
February 28th, 2019, 04:59 PM
#7
Re: SetTimer
Victorn, thanks.
F11 works for my source code well.
As for SetTimer, it is not my source code. How to find way to step into it?
-
March 1st, 2019, 12:12 AM
#8
Re: SetTimer
Originally Posted by ForestWang
Victorn, thanks.
F11 works for my source code well.
As for SetTimer, it is not my source code. How to find way to step into it?
You have to use MFC and need to have installed the MFC when you installed Visual Studio (or rerun the VS setup and install the MFC sources).
Once you have the MFC sources you can step into its code.
-
March 4th, 2019, 09:44 AM
#9
Re: SetTimer
Originally Posted by Arjay
You have to use MFC and need to have installed the MFC when you installed Visual Studio (or rerun the VS setup and install the MFC sources).
Once you have the MFC sources you can step into its code.
Thank you.
I installed MFC and loaded the symbol. then I can debug into it.
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
|