|
Hi,
Can I reset a Timer without doing a KillTimer?
For example if I created a Timer as
oldTimer = SetTimer(0, 2000, NULL);
later
SetTimer(oldTimer, 5000, NULL);
Is this going to reset the Timer to the new time.
Thanks,
gc
|
|
|
|
|
I don't know, try it and find out and let us all know.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
It has been a while since I played around with them but I'm pretty sure that if you try SetTimer as you suggested, the second one will fail since the timer with the given id has already been allocated. You can check the return value for yourself to be sure though.
|
|
|
|
|
From MSDN:If the hWnd parameter is not NULL and the window specified by hWnd already has a timer with the value nIDEvent, then the existing timer is replaced by the new timer. When SetTimer replaces a timer, the timer is reset. Therefore, a message will be sent after the current time-out value elapses, but the previously set time-out value is ignored. So there's no need to "reset" a timer (which you can't actually do anyway, you can only create it or kill it).
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Michael, thanks for your response.
I tested with the example program and WM_TIMER message is sent after the current time-out value elapsed.
|
|
|
|
|
Hi, I'm looking to access the Boot Sector (Absolute 0) and posibly edit the contents there (or slightly beyond there, so as not to adversly effect the OS).
I know that quicken tried this and ticked off their customer-base - me included. However, the powers that be in my life deem that I must do this also.
So, the question is: How can I access the Boot Sector on a FAT32 system using VC++ 6.0? Or do I have to use Assembly (Which I don't know - at all )?
Anyone?
|
|
|
|
|
|
While I've got your attention, I wanted to say thank you for some of your articles on The Code Project! They were extremely helpful.
Oh, and thanks!
|
|
|
|
|
|
Be aware that on NT, if you modify the MBR or any boot sector, the OS will come along a few seconds later and restore the sector from a backup copy that it keeps. You have to lock the volume before writing to the sector (however I don't know off-hand how to do this).
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Hi (for the second time today),
I'm getting the following error and im not sure why -
d:\projects\common\winctrls.cpp(145) : fatal error C1010: unexpected end of file while looking for precompiled header directive
When you double click the error (in VC6) it takes me to the end of "WinCtrls.cpp", which is the implementations of all of the class functions defined in "WinCtrls.h". Now I dont know much about the compilation process, but the only "non code" bits I have are a #IFNDEF, a #DEFINE, and a #ENDIF. Does anyone know what may be wrong. I'll try and explain further if needed.
Many thanks again
Zak
|
|
|
|
|
did you forget to add #include <stdafx.h> as the FIRST include statement in your .cpp file ?
have you forgotten something in a .h file somewhere ?
maybe an #endif or a closing brace } or a ;
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
In addition to the other reply you got you should also check to ensure that any third-party installed headers in 'some' directory are listed in your include paths in the Project Settings tool.
In the C++ tab under 'include directories' Add the *.h/hpp file to your 'include directories' settings:
ie: C:\thirdpartysdk\inc
In the Link tab under the 'Input' category, add the name that contains the library (*.lib file) to the class you're implementing.
As above, enter the path to the directory containing the lib file in the 'Additional Library Path.'
I know this is more than you need at this moment but I think it will help out in the future.
|
|
|
|
|
|
speaking of which, didn't the faq appeared on the top of the window ? I had to search for it yesterday
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
I asked Chris about it yesterday. He said he's redoing some parts of the site layout, and the FAQ link will come back soon (but it will only be visible when you're in the C++ forum).
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
I want to call print preview window of IE to preview "myfile.htm"
which similar with File/Print Preview... in IE command
Is it possible?
|
|
|
|
|
Hi all,
I am using this code to make my Menu disabled.
CMenu theMenu ;
theMenu.LoadMenu(IDR_MNU_MUM_MAIN) ;
CMenu *submenu = (CMenu*)theMenu.GetSubMenu(0) ;
submenu->EnableMenuItem(ID_FILE_SIGNOUT, MF_DISABLED |MF_GRAYED) ;
Kindly help me how to figure out why this is not working.
Thanks.
The Phantom.
|
|
|
|
|
|
Hi,
I want to make a dialog only based program without using MFC or anything. Problem is I need a parent HWND variable to send to the DialogBox() function. Im assuming I should pass the HWND of the desktop but Im not sure. If this is what I should be doing, how do I retrieve this, but if not, how should I go about this?
Thanks
Zak
|
|
|
|
|
You can either pass NULL , or a handle to the desktop window. You can retrieve this with GetDesktopWindow() .
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Harumph. I have 2 problems, one directly related to this function, the other is not.
First, i need to use SetDlgItemText() to display an integer in a static text thingy. At least, i assume this is what i should use. I can do it just fine displaying strings, but when i try to display an int, it says it can't convert int to LPCTSTR or something similar to that. Whats the best way to fix this? Should i use some sort of integer to string conversion?
Second, i need this integer to constantly update in my dialog. What i'm doing is reading a value from a volt meter, and for each reading i get, i want to display the new value. I tried putting my SetDlgItemText() in side an infinite for loop ( for(;;) ), but when i launch the dialog window, the program crashes. This is all opccuring in the dodataexcahnge.
Grr. its the simple problems that really tick me off. :P
*.*
cin >> knowledge;
|
|
|
|
|
1. SetDlgItemInt()
2. Using SetDlgItemInt() should solve this problem.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
doh, new it was a simple one. thanks.
I still have my refreshing problem tho, any ideas?
*.*
cin >> knowledge;
|
|
|
|
|
Do you know what's causing the crash? You mentioned it was in DoDataExchange() . Post your DoDataExchange() function and tell us which line is crashing.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|