1)dynamic creation of a Button ?

Answers were Sorted based on User's Feedback



1)dynamic creation of a Button ?..

Answer / rishabh

CButton myButton1;

// Create a push button.
myButton1.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON, 
   CRect(10,10,100,30), pParentWnd, 1);

Is This Answer Correct ?    5 Yes 1 No

1)dynamic creation of a Button ?..

Answer / ctharam

BOOL Ctharam::OnInitDialog()
{

CButton* pLogin;

pLogin = (CButton*)GetDlgItem(IDOK);

pLogin->SetWindowTextA("Login");

}

Is This Answer Correct ?    3 Yes 12 No

Post New Answer

More MFC Interview Questions

What is the size of class

18 Answers   Aircom,


What is LoadLibrary function returns?

7 Answers  


is there any class which is not derived from Cobject

11 Answers   Patni,


What are the advantages of using Doc/View or SDI over DialogBox

2 Answers  


what are the feauters of CObject

4 Answers   Siemens, Wipro,






Which MFC function is used to display output?

9 Answers   TCS,


Given two processes, how can they share memory?

2 Answers   Microsoft,


What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

5 Answers   Atos Origin,


What is Multithreading

1 Answers   Invensys,


General purpose classes in MFC

1 Answers   TCS,


Name the Synchronization objects?

2 Answers  


What is the difference between the SDI and MDI

3 Answers   Invensys,


Categories