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

C / C++ / MFC

 
GeneralDrawing a CListCtrl to a MemDC Pin
Alex Deem18-Feb-01 6:26
Alex Deem18-Feb-01 6:26 
GeneralRe: Drawing a CListCtrl to a MemDC Pin
Michael Dunn18-Feb-01 8:09
sitebuilderMichael Dunn18-Feb-01 8:09 
GeneralI need good Algourithm ... Pin
Hadi Rezaee18-Feb-01 6:23
Hadi Rezaee18-Feb-01 6:23 
GeneralRe: I need good Algourithm ... Pin
l a u r e n18-Feb-01 7:10
l a u r e n18-Feb-01 7:10 
GeneralRe: I need good Algourithm ... Pin
18-Feb-01 10:18
suss18-Feb-01 10:18 
GeneralRe: I need good Algourithm ... Pin
Christian Graus18-Feb-01 10:21
protectorChristian Graus18-Feb-01 10:21 
GeneralRe: I need good Algourithm ... Pin
Julien18-Feb-01 11:59
Julien18-Feb-01 11:59 
GeneralRe: I need good Algourithm ... Pin
Tim Deveaux19-Feb-01 10:24
Tim Deveaux19-Feb-01 10:24 
Here's a fun one -

Assuming MFC, you can use the ON_COMMAND_RANGE message map macro.

First, define all your buttons so that their ids are contiguous - i.e. IDC_BUTTON1 is 1000, IDC_BUTTON2 is 1001 etc.

Declare one handler as afx_message void MyButtons(UINT i). Then use the range macro to send all of the buttons clicks to that fn:

ON_COMMAND_RANGE(IDC_BUTTON1, IDC_BUTTON50, MyButtons)

Remember to put this outside the //}}AFX_MSG_MAP stuff, but still inside the BEGIN_MESSAGE_MAP sandwich.

Then, your code can look like this:
void CTestDlg::MyButtons(UINT i) 
{
	// do stuff based on i
	/*
	.
	.
	.
	*/
}


i should hold the id of the button pressed.
GeneralBackUp Files in VC++ Pin
Gleb18-Feb-01 0:00
Gleb18-Feb-01 0:00 
GeneralRe: BackUp Files in VC++ Pin
Christian Graus18-Feb-01 10:24
protectorChristian Graus18-Feb-01 10:24 
Generalsingleton class Pin
17-Feb-01 19:08
suss17-Feb-01 19:08 
GeneralRe: singleton class Pin
Michael Dunn17-Feb-01 19:48
sitebuilderMichael Dunn17-Feb-01 19:48 
GeneralSelf destructing exe Pin
17-Feb-01 18:18
suss17-Feb-01 18:18 
GeneralRe: Self destructing exe Pin
l a u r e n18-Feb-01 4:53
l a u r e n18-Feb-01 4:53 
GeneralRe: Self destructing exe Pin
19-Feb-01 9:03
suss19-Feb-01 9:03 
GeneralRe: clown chips Pin
l a u r e n19-Feb-01 11:04
l a u r e n19-Feb-01 11:04 
GeneralRe: Self destructing exe Pin
Jason De Arte19-Feb-01 8:23
Jason De Arte19-Feb-01 8:23 
GeneralRe: Self destructing exe Pin
19-Feb-01 9:08
suss19-Feb-01 9:08 
GeneralSelf destructing exe Pin
17-Feb-01 18:15
suss17-Feb-01 18:15 
GeneralHRESULT and SetLastError Pin
PJ Arends17-Feb-01 16:09
professionalPJ Arends17-Feb-01 16:09 
GeneralRe: HRESULT and SetLastError Pin
Ancient Dragon17-Feb-01 17:26
Ancient Dragon17-Feb-01 17:26 
GeneralRe: HRESULT and SetLastError Pin
Tim Deveaux18-Feb-01 4:12
Tim Deveaux18-Feb-01 4:12 
GeneralRe: HRESULT and SetLastError Pin
PJ Arends19-Feb-01 6:41
professionalPJ Arends19-Feb-01 6:41 
GeneralRe: HRESULT and SetLastError Pin
Tim Deveaux19-Feb-01 13:10
Tim Deveaux19-Feb-01 13:10 
QuestionHow does..... Pin
17-Feb-01 12:47
suss17-Feb-01 12:47 

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.