Click here to Skip to main content
15,891,943 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: multithreaded programming on multicore systems Pin
Gary R. Wheeler19-Apr-08 1:52
Gary R. Wheeler19-Apr-08 1:52 
GeneralRe: multithreaded programming on multicore systems Pin
CPallini19-Apr-08 2:25
mveCPallini19-Apr-08 2:25 
QuestionHow to Compare two different date format Pin
sharanu18-Apr-08 22:55
sharanu18-Apr-08 22:55 
AnswerRe: How to Compare two different date format Pin
Gary R. Wheeler19-Apr-08 1:07
Gary R. Wheeler19-Apr-08 1:07 
GeneralRe: How to Compare two different date format Pin
sharanu19-Apr-08 1:59
sharanu19-Apr-08 1:59 
AnswerRe: How to Compare two different date format Pin
David Crow19-Apr-08 3:26
David Crow19-Apr-08 3:26 
GeneralAny Control with huge buttons. Pin
phanindra varma18-Apr-08 22:35
phanindra varma18-Apr-08 22:35 
GeneralRe: Any Control with huge buttons. Pin
Gary R. Wheeler19-Apr-08 1:18
Gary R. Wheeler19-Apr-08 1:18 
If you are using MFC, you can have a single handler respond to a group of controls using ON_CONTROL_RANGE()[^]. This would let you have a single handler, like this:
// in your message map:
ON_CONTROL_RANGE(BN_CLICKED,IDC_B1,IDC_B112,OnB)
// handler:
void MyClass::OnB(UINT ID)
{
  static struct {
    UINT ID;
    int  a;
  } table[] = {
    { IDC_B1, 1 },
    { IDC_B2, 15 },
    //...
    { IDC_B112, 30 }
  };
  for (int i = 0; i < (sizeof(table) / sizeof(table[0])); i++) {
    if (table[i].ID == ID) {
      DoMyDuty(table[i].a);
      break;
    }
  }
}
The handler is called with the resource ID of the button that was clicked. It then uses a simple table to look up the value of 'a' to use for the call to the DoMyDuty() function.

Software Zen: delete this;
Fold With Us![^]

GeneralRe: Any Control with huge buttons. Pin
krmed19-Apr-08 3:30
krmed19-Apr-08 3:30 
GeneralRe: Any Control with huge buttons. Pin
Gary R. Wheeler19-Apr-08 4:00
Gary R. Wheeler19-Apr-08 4:00 
GeneralRe: Any Control with huge buttons. Pin
phanindra varma21-Apr-08 20:05
phanindra varma21-Apr-08 20:05 
General[Message Deleted] Pin
Laurence18-Apr-08 22:10
Laurence18-Apr-08 22:10 
QuestionRe: How to resolve follow problem? about math Pin
CPallini18-Apr-08 22:18
mveCPallini18-Apr-08 22:18 
JokeRe: How to resolve follow problem? about math Pin
Hamid_RT19-Apr-08 1:24
Hamid_RT19-Apr-08 1:24 
GeneralRe: How to resolve follow problem? about math Pin
CPallini19-Apr-08 1:42
mveCPallini19-Apr-08 1:42 
GeneralRe: How to resolve follow problem? about math Pin
Eytukan19-Apr-08 22:32
Eytukan19-Apr-08 22:32 
GeneralRe: How to resolve follow problem? about math Pin
CPallini19-Apr-08 22:43
mveCPallini19-Apr-08 22:43 
GeneralRe: How to resolve follow problem? about math Pin
Hamid_RT20-Apr-08 8:55
Hamid_RT20-Apr-08 8:55 
GeneralRe: How to resolve follow problem? about math Pin
Hamid_RT20-Apr-08 8:54
Hamid_RT20-Apr-08 8:54 
QuestionSome options to display HTML in a MFC control ? Pin
cagespear18-Apr-08 20:09
cagespear18-Apr-08 20:09 
AnswerRe: Some options to display HTML in a MFC control ? Pin
Hamid_RT18-Apr-08 20:23
Hamid_RT18-Apr-08 20:23 
GeneralRe: Some options to display HTML in a MFC control ? Pin
cagespear19-Apr-08 5:23
cagespear19-Apr-08 5:23 
AnswerRe: Some options to display HTML in a MFC control ? Pin
Gary R. Wheeler19-Apr-08 1:20
Gary R. Wheeler19-Apr-08 1:20 
GeneralRe: Some options to display HTML in a MFC control ? Pin
cagespear19-Apr-08 5:17
cagespear19-Apr-08 5:17 
GeneralRe: Some options to display HTML in a MFC control ? Pin
Gary R. Wheeler19-Apr-08 12:29
Gary R. Wheeler19-Apr-08 12:29 

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.