Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

C++

Articles on C++ programming language.

Fixed MFC SDI Window Using CREATESTRUCT & PreCreateWindow

Fixed Size MFC SDI Application

In this Example, we will look at wiping out the minimize and resize button from the MFC Single Document Interface (SDI) Application using PreCreateWindow Override and CREATESTRUCT. Of course, we can do that with the MFC Wizard itself. However, that option is restricted to design time. Moreover, knowing how to carry out this in run-time is useful as the Application can behave based on the INI file or configuration file settings.

Continue Reading →

Message Handling in MFC Application Explained

Defining the Redraw clipping region

Software application user interacts with the windows applications through the main external devices like Keyboard and Mouse. In MFC, hardware events from these devices are seen as ‘Windows Messages’. An MFC application programs responding to these windows messages are called ‘Message Handling’. In this example, we will create an MFC SDI Application and then Handle Left and Right mouse click events. This will make you understand how windows messages are handled in the MFC Applications.

Continue Reading →

C++ Signal And Raise Example

Signal and Handler function

[toc] 1. C++ Signal and Raise – An Introduction C++ device driver programs can use the signal() and raise() in combination to perform interrupts using SIGINT type. When a program is running, one can interrupt it by making a call to the Raise function. Before we make a call to the raise function, we should register the Signal handling function. The function signal() registers the Signal Handling Function. The signal […]

Continue Reading →