T
TogaKangaroo
Hi, I'm trying to get intimate with my new copy of the .NET Pro
developing environment, specifically C++ Visual Studio. I have a book
(VC++ in 21 days) that I am going through following their examples.
However the book treats the MS VC++ 6.0 environment and I...as I
mentioned am learning .NET.
It hasn't been too large a problem so far, I'm have a comp sci degree
and have done plenty of c++ so where the two don't match up I've been
mostly able to figure it out. However I am having problems figuring
out how to make an event handler for timers or mouse actions.
I think It all spawns from the same problem so if I can figure out
timers I can probably handle the rest. So far I have done the
following:
-Added a resource symbol ID_CLOCK_TIMER (am I correct that this simply
adds a #define ID_CLOCK_TIMER line to resource.h?)
-did SetTimer(ID_CLOCK_TIMER, 1000,NULL); in OnInitDialog()
Now the book states I can click on my main dialog box(main window) and
do add event handler to handle the WM_TIMER message. .NET won't let me
add an event handler to the main message box however and for no place
where I CAN add an event handler do I see the WM_TIMER message as an
option in the wizard. I tried adding a handler manually (from what I
understood should be done)
and added
public:
afx_msg void OnTimer(UINT_PTR nIDEvent);
to my main dialog class (it is derived from CDialog)
as well as a definition
void CTimeyDlg::OnTimer(UINT_PTR nIDEvent) {
MessageBox("Yo");
}
Nothing happens however.
Can anyone help me out here?
Thanks a lot
Toga
developing environment, specifically C++ Visual Studio. I have a book
(VC++ in 21 days) that I am going through following their examples.
However the book treats the MS VC++ 6.0 environment and I...as I
mentioned am learning .NET.
It hasn't been too large a problem so far, I'm have a comp sci degree
and have done plenty of c++ so where the two don't match up I've been
mostly able to figure it out. However I am having problems figuring
out how to make an event handler for timers or mouse actions.
I think It all spawns from the same problem so if I can figure out
timers I can probably handle the rest. So far I have done the
following:
-Added a resource symbol ID_CLOCK_TIMER (am I correct that this simply
adds a #define ID_CLOCK_TIMER line to resource.h?)
-did SetTimer(ID_CLOCK_TIMER, 1000,NULL); in OnInitDialog()
Now the book states I can click on my main dialog box(main window) and
do add event handler to handle the WM_TIMER message. .NET won't let me
add an event handler to the main message box however and for no place
where I CAN add an event handler do I see the WM_TIMER message as an
option in the wizard. I tried adding a handler manually (from what I
understood should be done)
and added
public:
afx_msg void OnTimer(UINT_PTR nIDEvent);
to my main dialog class (it is derived from CDialog)
as well as a definition
void CTimeyDlg::OnTimer(UINT_PTR nIDEvent) {
MessageBox("Yo");
}
Nothing happens however.
Can anyone help me out here?
Thanks a lot
Toga