Click here to Skip to main content
15,911,711 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How can I do a Dynamic Array like CByteArray for a STRUCT array ? Pin
Leo Smith5-Oct-01 11:05
Leo Smith5-Oct-01 11:05 
AnswerRe: How can I do a Dynamic Array like CByteArray for a STRUCT array ? Pin
Fazlul Kabir5-Oct-01 11:27
Fazlul Kabir5-Oct-01 11:27 
GeneralRe: How can I do a Dynamic Array like CByteArray for a STRUCT array ? Pin
Christian Graus5-Oct-01 16:53
protectorChristian Graus5-Oct-01 16:53 
GeneralRe: How can I do a Dynamic Array like CByteArray for a STRUCT array ? Pin
Fazlul Kabir6-Oct-01 11:28
Fazlul Kabir6-Oct-01 11:28 
GeneralRe: How can I do a Dynamic Array like CByteArray for a STRUCT array ? Pin
Christian Graus6-Oct-01 11:51
protectorChristian Graus6-Oct-01 11:51 
GeneralRe: How can I do a Dynamic Array like CByteArray for a STRUCT array ? Pin
Fazlul Kabir6-Oct-01 18:06
Fazlul Kabir6-Oct-01 18:06 
GeneralCListView with a Timer Pin
daniel995-Oct-01 10:14
daniel995-Oct-01 10:14 
GeneralRe: CListView with a Timer Pin
Andres Manggini5-Oct-01 10:43
Andres Manggini5-Oct-01 10:43 
This should be helpful:

CWnd::SetTimer
UINT SetTimer( UINT nIDEvent, UINT nElapse, void (CALLBACK EXPORT* lpfnTimer)(HWND, UINT, UINT, DWORD) );

Return Value

The timer identifier of the new timer if the function is successful. An application passes this value to the KillTimer member function to kill the timer. Nonzero if successful; otherwise 0.

Parameters

nIDEvent

Specifies a nonzero timer identifier.

nElapse

Specifies the time-out value, in milliseconds.

lpfnTimer

Specifies the address of the application-supplied TimerProc callback function that processes the WM_TIMER messages. If this parameter is NULL, the WM_TIMER messages are placed in the application’s message queue and handled by the CWnd object.

Remarks

Installs a system timer. A time-out value is specified, and every time a time-out occurs, the system posts aWM_TIMER message to the installing application’s message queue or passes the message to an application-defined TimerProc callback function.

The lpfnTimer callback function need not be named TimerProc, but it must be defined as follows:

void CALLBACK EXPORT TimerProc(
HWND hWnd, // handle of CWnd that called SetTimer
UINT nMsg, // WM_TIMER
UINT nIDEvent // timer identification
DWORD dwTime // system time
);

Timers are a limited global resource; therefore it is important that an application check the value returned by the SetTimer member function to verify that a timer is actually available.

Example

// This example shows how to use CWnd::SetTimer, CWnd::KillTimer, and how to handle WM_TIMER messages. A timer is set up to send a WM_TIMER message to the main frame window every 2 seconds in OnStartTimer(). OnStopTimer will stop the timer by calling CWnd::KillTimer. OnTimer was set up through class wizard to handle WM_TIMER messages for the main frame window. In this example the PC speaker will beep every 2 seconds.

void CMainFrame::OnStartTimer()
{
m_nTimer = SetTimer(1, 2000, 0);
}

void CMainFrame::OnStopTimer()
{
KillTimer(m_nTimer);
}

void CMainFrame::OnTimer(UINT nIDEvent)
{
MessageBeep(0xFFFFFFFF); // Beep

// Call base class handler.
CMDIFrameWnd::OnTimer(nIDEvent);
}




Andres Manggini.
Buenos Aires - Argentina.
QuestionHow do I use CButton::Create() to make a push button check box? Pin
Bart-Man5-Oct-01 10:12
Bart-Man5-Oct-01 10:12 
AnswerRe: How do I use CButton::Create() to make a push button check box? Pin
Fazlul Kabir5-Oct-01 10:17
Fazlul Kabir5-Oct-01 10:17 
GeneralRe: How do I use CButton::Create() to make a push button check box? Pin
Bart-Man5-Oct-01 10:22
Bart-Man5-Oct-01 10:22 
AnswerFinal Solution Pin
Bart-Man5-Oct-01 10:55
Bart-Man5-Oct-01 10:55 
GeneralConnect() timeout Pin
Alex Griffing5-Oct-01 9:27
Alex Griffing5-Oct-01 9:27 
GeneralOverriding CWndClassInfo in ATL Pin
5-Oct-01 8:05
suss5-Oct-01 8:05 
GeneralDisplay attributes Pin
john john mackey5-Oct-01 7:32
john john mackey5-Oct-01 7:32 
GeneralRe: Display attributes Pin
5-Oct-01 7:36
suss5-Oct-01 7:36 
GeneralDisabling item in CListCtrl Pin
5-Oct-01 7:02
suss5-Oct-01 7:02 
GeneralRe: Disabling item in CListCtrl Pin
Masaaki Onishi5-Oct-01 9:59
Masaaki Onishi5-Oct-01 9:59 
GeneralCreating window like Taskbar Pin
5-Oct-01 6:57
suss5-Oct-01 6:57 
GeneralRe: Creating window like Taskbar Pin
Michael Dunn5-Oct-01 8:27
sitebuilderMichael Dunn5-Oct-01 8:27 
GeneralRe: Creating window like Taskbar Pin
Ravi Bhavnani6-Oct-01 8:02
professionalRavi Bhavnani6-Oct-01 8:02 
GeneralRe: Creating window like Taskbar Pin
Michael P Butler6-Oct-01 9:05
Michael P Butler6-Oct-01 9:05 
GeneralAfxTrace without MFC Pin
Steven Mitcham5-Oct-01 5:37
Steven Mitcham5-Oct-01 5:37 
GeneralRe: AfxTrace without MFC Pin
Chris Losinger5-Oct-01 5:48
professionalChris Losinger5-Oct-01 5:48 
GeneralRe: AfxTrace without MFC Pin
Steven Mitcham5-Oct-01 8:06
Steven Mitcham5-Oct-01 8:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.