New MFC Interview Questions :: ALLInterview.com http://www.allinterview.com New MFC Interview Questions en-us Hi All, I have created one MFC Dialog Based application.now if i am http://www.allinterview.com/showanswers/76249.html if(NULL != ::CreateMutex(NULL, TRUE, _T("CSingleInstanceApp"))) { long dwError = ::GetLastError(); if(dwError == ERROR_ALREADY_EXISTS) EndDialog(IDOK); } Paste the above code snippet inside the "InitInstance" func What is CALLBACK? How it work? what is the advantage of CALLBACK, pl http://www.allinterview.com/showanswers/75769.html • callback function is a function that is called through a function pointer. • pass the pointer (address) of a function as an argument to another, when that pointer is used to call the function it points to it is said that a call back is made How WM_PAINT message gets called in MFC,please explain it . a)Who cal http://www.allinterview.com/showanswers/75276.html a)The framework calls this member function b)This function get called, when Windows or an application makes a request to repaint a portion of an application's window. c) 1)why we cant create more than one instance of the class Derived from http://www.allinterview.com/showanswers/74999.html You theApp object is replace with new name; Eg CdlgtestApp theApp; CdlgtestApp theApp3; // now this is your applcation obj CdlgtestApp theApp3; CdlgtestApp theApp; // No effect 2.create for 10 batch: Employee_Number Employee_name http://www.allinterview.com/showanswers/74406.html 1.Get string1,string2,string3 1.add string1 and 2,string1 and 3. http://www.allinterview.com/showanswers/74405.html Differ GetMessage, PostMessage & PeakMessage? http://www.allinterview.com/showanswers/72480.html PostMessage is used in Threading usually. to post a message to Messaging Queue. Get message is a blocking call it waits for the message untill it recieve the message it was requiring Peak message doesnt wait for the message particually i what is message Testing ? http://www.allinterview.com/showanswers/71629.html How can i change the color of a dropdowncombobox elements http://www.allinterview.com/showanswers/71033.html to change color of all controls window message "WM_CTLCOLOR" needs to process in MFC this can be done by modifying OnCtlColor() eg. HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) Why Array Index starts from Zero http://www.allinterview.com/showanswers/70478.html This boils down to the concept of Binary digits. Take an array size of 64 for example. We start from 0 and end at 63. We require 6 bits.But, if we were to start from 1 and end at 64, we would require 7 bits to store the same number, thus incr How we can findout Memoryleaks, In what way it can be avoided http://www.allinterview.com/showanswers/70325.html To find out the memory leaks there are several ways 1. Use Permon utility provided by Microsoft 2. Collect the memory leak dump using Debug Diag and investigate. What is the initial function to be called in MFC and what it will do http://www.allinterview.com/showanswers/70324.html The WinMain function is called by the system as the initial entry point for a Windows-based application. It initializes the application, display its main window, and enter a message retrieval-and-dispatch loop that is the top-level control st How can i implement the dynamic menus in MFC plz give the code http://www.allinterview.com/showanswers/69659.html Create a CMenu object on the stack frame as a local, then call CMenu’s member functions to manipulate the new menu as needed. Use the following function to create the same 1. LoadMenu,SetMenu or TrackPopupMenu function I can i set size of integer variable should be fixed for different o http://www.allinterview.com/showanswers/69658.html one can define integer class like class Int { byte data[2]; public: //overload all basic operation of integer here //like + - etc }; What is difference between the TCP/IP and UDP socket http://www.allinterview.com/showanswers/69654.html TCP/IP is connection oriented and UDP is Connection less protocol.