 |
|
 |
great work. Thank you very much
|
|
|
|
 |
|
 |
Hi Dave...
thank about your excellent example in how to program a clock with repeat capability
May I ask u several question
If i used repeat function in this program (eg: if I set each 1 hour, the alarm will trigger in 36 time) when the alarm trigger, I want the program will do something (eg: read file, saving file, read database, doing calculation)...of course we need to modified this program
1. which member function can we used to set this procedure.
2. if i want to call document file in each 1 hour (when the alarm trigger) using shellcommand, which member function we will used.
thank a lot if u can help
regard
|
|
|
|
 |
|
 |
Hello,
I'm using the latest code you posted here (thanks for the update by the way):
http://www.davee.com/codeproject[^]
I may be doing something wrong with your class, or perhaps I just misunderstand how parts of it are supposed to work, but it appears that even your sample application exihibts a couple issues that are easy to reproduce. The sample application attached to this article (older version), only triggers the alarm once as expected so I wonder if the changes made to the class itself introuduced these issues.
---
The first scenario uncorrectly generates alarms non-stop. To reproduce with your latest sample app:
1) Launch up the sample app, ClockTest.exe
2) Select "Repeat by Weekday"
3) Select the current day (only)
4) Set the time forward by 30 seconds and click Set Alarm button
5) After the 30 seconds passes, and the alarm gets triggered, you'll notice that it gets caught in a loop of infinite alarms.
---
The second scenario deals with the alarm getting triggered on incorrect days. To reproduce with your latest sample app:
1) Launch up the sample app, ClockTest.exe
2) Select "Repeat by Weekday"
3) Select any single day that is NOT the current day
4) Set the time forward by 30 seconds and click Set Alarm button
5) After the 30 seconds passes, you see that the alarm gets triggered even though it was not supposed to be triggered. This get triggered in both the old version and the new version of your sample application, so it might have been there for a while.
--
Please let me know if these are issues with the code, or if I am just mis-using your class somehow.
Thanks!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
 |
|
 |
Thanks for the bug report. I'm going to look into it this weekend.
BTW: I usually don't check my gmail acct very often. Next time, it would be best to send to c_o_d_e@d_a_v_e_e.com (remove '_'). But I need to contact CP and ask them why the email notify doesn't work. I checked the account settings and they DO specify the correct email address but it no longer notifies me for some reason.
Regards,
Dave
|
|
|
|
 |
|
 |
Hi Extralean,
I looked into the two problems and was not able to recreate the first problem where alarms are triggered repeatedly. Why we're both seeing different behavior is a mystery.
ExtraLean wrote: The first scenario uncorrectly generates alarms non-stop. To reproduce with your latest sample app:
1) Launch up the sample app, ClockTest.exe
2) Select "Repeat by Weekday"
3) Select the current day (only)
4) Set the time forward by 30 seconds and click Set Alarm button
5) After the 30 seconds passes, and the alarm gets triggered, you'll notice that it gets caught in a loop of infinite alarms.
In my case, I followed the steps above and the result was one alarm was triggered after 30 seconds and then the next alarm indicator said that the next alarm was set for the same time on Fri Dec 5th. But there were no more alarm events after the first one.
The 2nd bug is normal behavior if I understand the steps correctly. In your test, you set the alarm time for 30 seconds into the future and had a weekday repeat alarm set. This should trigger one alarm after 30 seconds (as you said it did) then it should arm the next alarm to be on the weekday indicated in the repeat settings.
Did I undersatand your issue correctly?
The repeat alarm settings will not affect the next alarm time, but only come into play AFTER the initial alarm is triggered. In your 2nd case, you were not expecting the 1st alarm to be triggered. But the repeat info doesn't prevent the 1st alarm from occurring.
Hope I understood the problem correctly. Let me know if I'm mistaken.
BTW: Can you help me test my email by clicking the email link and send me something that way to see if it works? I haven't received anything at the code@... address in a while but I expect it to work still.
|
|
|
|
 |
|
 |
When you're ready to troubleshoot this thing, let me know and I can make suggestions to learn what is happening inside the class. I can suggest where to put a "beeper" inside the code to see why it's behaving that way.
My only theories of why it has multiple repeated alarms is that there is either something dofferent about your version of Windows than mine and I didn't take that difference into consideration when I wrote the code, or it could be a mismatch of files in your setup, perhaps.
|
|
|
|
 |
|
 |
Thanks, Dave... I just sent you an email to the address you specified letting you know that I'm ready now to help you resolve this issue. Have a great day.
Ed
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
 |
|
 |
Can someone give me a sample or hint on how to use the callback implementation of SetAlarm. I tried some different approaches found here on codeproject but without any success.
Suppose I want to call a function MyFunc in the class MyClass as soon as the alarm time is reached. The function MyFunc has one parameter of type integer. How do I have to declare the function? And how do I include the function in the SetAlarm call.
Thanks for any response.
|
|
|
|
 |
|
 |
Sorry for not including an example of this in the sample project.
I am going to try to help without testing it myself:
To code the call to SetAlarm using the callback, type it in something like this example which sets an alarm for the same time tomorrow.
CAlarmClock clock;
SYSTEMTIME st;
GetLocalTime(&st);
st.wDay++;
clock.SetAlarm(&st, CallbackRtn, (DWORD_PTR) this);
BOOL __stdcall CallbackRtn(CAlarmClock* pThis, DWORD_PTR dwUserData)
{
return TRUE;
}
Hope this helps,
|
|
|
|
 |
|
 |
Hi Dave, thanks for the response. I’ll give it a try.
Berni
|
|
|
|
 |
|
 |
Here's a tested example using the callback. It sets an alarm for 5 seconds into the future and makes a beep noise when the alarm is triggered.
BOOL __stdcall CallbackRtn(CAlarmClock* pThis, DWORD_PTR dwUserData)
{
Beep(1000,50);
Beep(2000,50);
Beep(4000,50);
Beep(8000,50);
return TRUE;
}
CAlarmClock clock;
UFT u1;
u1 = clock.GetTime();
u1.ll += 5 * ONE_SECOND;
clock.SetAlarm(u1.ft, CallbackRtn);
|
|
|
|
 |
|
 |
Hi Dave,
Thanks for the example but if I use your example I will get the following error:
Error C3867: ‘CMailSendWorker::CallbackRtn’: function call missing argument list; use ‘&CMailSendWorker::CallbackRtn’ to create a pointer to member
Would you be so kind to explain me why I get this error? Or perhaps you can include the example into the CalarmClock Demo Project on your website. So I can see it ‘live’.
I believe it’s a very simple issue but I can’t figure out why it won’t work.
Best whishes,
Berni
|
|
|
|
 |
|
 |
I don't know why this error is happening and would need to see your source to have a chance at a guess
But I uploaded the project that I used to test the example I posted.
Check the web site for the zip file.
http://www.davee.com/codeproject
My example requires the files "Alarmclock.cpp and .h" to be in the ..\ path relative to this project. Those files aren't included in the zip, but you can get them from the other zip on my website, of course.
Regards,
Dave
|
|
|
|
 |
|
 |
Hi Dave,
Sorry for the late response. Your upload gave me the clue. My way of thinking how to implement the callback was wrong. My mistake was to redefine the CallbackRtn. It works fine now. Many thanks for your response.
Regards,
Berni
You’ve got my 5
|
|
|
|
 |
|
 |
Hello
posted this in december 2007 with no reply so im trying again
I changed the app title and other stuff in the Alarm Clock dialog .rc file to make it bigger and I changed the title and buttons and so on. After I rebuilt the .sln project file and ran the finished compiled project the application(.exe) asks for msvcr80d.dll and other .dll files aswell.
How come? Can you tell me how i can change your code without this happening? Would be nice to have some hints here
best regards
Malibu04
|
|
|
|
 |
|
 |
Hello,
Just thought I'd check in here to see if you've had a chance to finish polishing up the code for the changes you made to this class a while back. Would you be able to update the article please? This is a great piece of code, and I'm looking to get your latest updates as I'm using it in a project.
Thanks!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
 |
|
 |
Just wondering if you are still around... Please reply either way, no worries!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
 |
|
 |
Sorry for the delay getting back in here. I don't know how to turn on alerts so that articles in this forum will notify me at my email account. i use the setting called "Notify me by e-mail if someone answers this message" but CP doesn't notify me when someone posts a new thread here.
Any way to fix this CP?
|
|
|
|
 |
|
 |
No problem, Dave. I'm just glad to see that CAlarmClock is still alive and well
Looking forward to your update.
Thanks!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
 |
|
 |
I've made a lot of changes to the class and need to rewrite the web page. But I haven't had time to update it. I'm working on a project that's taking all my time from maintaining this documentation here.
But I can put the current class on my own web site if anyone wants to download it.
http://www.davee.com/codeproject
I'll try to update the web article here soon.
|
|
|
|
 |
|
 |
Thank you for posting that. I've downloaded it and will be giving it a look-over today. Your time is much appreciated by many, thank you for taking the time to do this, and thank you in advance for updating the article (whenever you do have a chance to do so), as I'll be looking forward to the updated documentation as well.
Have a great day!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
 |
|
 |
DaveeCom wrote: But I can put the current class on my own web site if anyone wants to download it.
I just created a new message on this article to explain a possible issue I found with CAlarmClock. I figured I'd reply to this message as well, since I remember that you weren't getting email notifications before and hopefully this will trigger one for you.
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
 |
|
 |
Hello
I changed the app title and other stuff in the Alarm Clock dialog .rc file to make it bigger and I changed the title and buttons and so on. After I rebuilt the .sln project file and ran the finished compiled project the application(.exe) asks for msvcr80d.dll and other .dll files aswell.
How come? Can you tell me how i can change your code without this happening? Would be nice to have some hints here
best regards
Malibu04
|
|
|
|
 |
|
 |
I don't have the same build environment as yours, perhaps. I'm still using VStudio.Net 2003.
You're on your own unless someone else can jump in and help.
|
|
|
|
 |
|
 |
Thanks for codes.
for LOVE.
|
|
|
|
 |