CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

C++

C++ Programming

COM – Creating a COM Component using C++ – LoadLibrary

When we run our test application, we were getting a message “No such interface supported”. It seems, CreateInstance was failed to return the instance of the component. Before looking into the way CreateInstance creates an instance of our component; let us test our DLL by calling exported functions directly without the help of COM library. To do […]

COM – Creating a COM Component using C++ – .def file

In the previous article, we created a test application to test our COM component. When we rant our test application, it was displaying a “Class not registered” error message. Before re-looking into our component and test application code; let’s understand in what scenarios this “Class not registered” error message occurred. One scenario is, unable to find the […]

C++ – Calling Virtual functions from class Destructors

C++ allows virtual functions to resolve function calls at run-time. This is called late-binding. Like virtual functions, C++ allows virtual destructors to delete the objects properly in an inheritance hierarchy. C++ allows calling virtual functions from class destructors. But what will happen when it calls these virtual functions from class destructors? Let’s take an example, […]

C++ – Calling Virtual functions from class Constructors

Virtual keyword in C++ is used for polymorphic behavior. C++ allows the creation of virtual functions, virtual destructors, and virtual inheritance. Virtual functions will resolve exact function calls in the inheritance hierarchy, at run-time. This is called late-binding. That means, what function to call will come to know at run-time instead of compile time. // […]

C++ – Multiple Inheritance – Virtual inheritance to overcome inheritance ambiguity

Another interesting feature of Object Oriented Programming is its inheritance. Inheritance inherits the behavior or attributes from its parent or base classes to the derived classes. C++ uses virtual inheritance to overcome the inheritance ambiguity in multiple inheritance. Multiple inheritance means, derived classes inherit from multiple base classes. Inheritance ambiguity will occur when a derived class […]

C++ – Class Constructors

In C++, class constructors are special kind of methods to instantiate a class. When the class’s object is going to create, C++ will first call the class’s constructor to initialize the class. Initializing the class means, assigning its members and allocating any dynamic memory, etc., After the class’s constructor is called, the class’s object creation […]

MFC – Convert C++ Class to MFC based class

Microsoft Foundation Classes (MFC) are used to develop Windows based applications. MFC supports Document-View architecture; where data management separates from presentation layer. MFC wraps portions of Windows API C++ classes and enables to use them easily. In this article, we will discuss how to enable MFC to a simple C++ class. Let’s take a simple […]

Scroll to top
Exit mobile version