What are the most Frequently asked questions on VC++ Interviews ?
Visual C++ MFC FAQ Part II
Visual C++
PRACTICE QUIZ
Directions for using Microsoft Visual C++ 2008 Exp…
Windows Socket Faq’s
MFC – Microsoft Foundation Classes, GUI Developmen…
SDI and MDI Applications, Doc/View Architecture
Dialog Based Applications
The workspace, the VC++ IDE, Visual Studio Editor
Sample VC++ Project – Making a Data Viewer
C++ Essentials
Behind the scenes, Handles and Messages
What is COM – Component Object Model ?
Visual Studio 2003 & [...]
Creating & Adding Custom control to the in-built gallery of controls
Many a times we create a control and need to reuse it in number of other applications. Instead of creating the class having the same functionality or copying the already created classes we can add the created control to the in-built gallery of controls. We can then add this control to the project as and [...]
Full Story »What is a Windows Hook?
A C programmer is often very excited when he creates his first TSR. A TSR is a ‘Terminate but Stay Resident program’ which continues to remain in memory even if the program is terminated. One can use a TSR for number of purposes like displaying a clock on output screen, keeping track of user’s actions, [...]
Full Story »Opening the document from the top of the recent file list automatically.
How to make sure that the application automatically opens the document that is at the top of the recent file list?
Ans: #include the ‘afxadv.h’ file in the application class’s source file. This file is required for CRecentFileList class’s definition. Add the following code in InitInstance( ) to open the first file in MRU list.
BOOL CMRUApp::InitInstance( [...]
How to display an hourglass cursor ?
Ans: Many a times our application needs quite a long time to complete a particular task. For example, we may search for a file or browse the hard disk or sort a large number of items. At such times we can display an hourglass cursor to show that the application is busy doing the task. [...]
Full Story »How to prevent dialog box from getting dismissed On pressing Esc key ?
If a dialog box is displayed and Esc key is pressed, OnCancel( ) handler gets called and the dialog gets dismissed. At times we want to take some other step when Esc key is pressed. For example, if user has selected an item from a combo box we may want that his selection should get [...]
Full Story »How can show right click properties in user-designed dialog?
If we right click on a file or a directory a pop up menu is displayed from which we can select the ‘Properties’ menu item to display the properties of the selected file/directory. How can we achieve the same in a user-designed dialog?
We will write a small program in which if user clicks a button [...]
How would you set an indicator in the caption bar indicating that the document is dirty and needs to be saved?
Ans: While working in a VC++ source editor if you observe carefully, you would see that if you make any changes in a file an indicator in the form of an asterisk ( ‘*’ ) is shown in the title bar indicating that the file is modified. If you save the file the indicator disappears. [...]
Full Story »Different multi-threading problems
In the last few articles we saw how to use the synchronization classes. In this article we would discuss when to use these classes. We would also see how to use synchronization access classes like CSingleLock and CMultiLock.
To determine which synchronization class we should use follow the rules given below:
If [...]
Full Story »