Programming Examples

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


Articles on C++ programming language.

MFC DialogBar Explained With Example

MFC DialogBar Example

In this example, we will see how to create and use MFC DialogBar Control. The DialogBar acts like a toolbar. Unlike toolbar, a dialog bar can have controls which we can place in it treating it as dialog. One can dock the DialogBar like a toolbar. To better visualize it, we can think of a tool bar with a radio button, a checkbox and a combo box in it. What we just now imagined can be easily achieved through a DialogBar control.

In this example we will design an MFC DialogBar, then we will place that in a Rebar Control so that we can dock it on the Main Frame window of the SDI application.

Continue Reading →

File Processing using CreateFile, ReadFile and WriteFile Win32 APIs

Win32 CreateFile Example

In this article, we will look at the example of using the CreateFile, ReadFile, WriteFile and OpenFile win32 API functions with an MFC Dialog based application. Win32 is a very rich API that supplies many functions and MFC is a Framework wrapped over those functions to form a logical working unit. Win32 API library is in a native format that means it is in C style (Procedural Approach) whereas MFC is an OOPS based Framework API. OK, let us start with the sample.

Continue Reading →