Author: venkat

COM: Creating a COM Component using C++ (Part-8)

As we discussed in our previous articles, COM’s CoCreateInstance function is used to create instances for COM classes. When the client program calls CoCreateInstance to create an instance of COM class: It actually internally calls another function CoGetClassObject CoGetClassObject checks the…

COM: Creating a COM Component using C++ (Part-7)

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…

MFC: CObject class (Part – 2)

CObject supports object serialization. One of the MFC’s great feature, which allows to store and retrieve the object’s current state. To enable this feature in our code: We must add DECLARE_SERIAL macro into our class declaration. IMPLEMENT_SERIAL macro must be…

COM: Creating a COM Component using C++ (Part-6)

DLL with exported functions showing in Microsoft's Dependency Walker Tool

In previous article, we have created a test application to test our COM component. When we rant our test application, it was displaying “Class not registered” error message. Before re-looking into our component and test application code; lets understand in what scenarios…

C++: Why virtual? (Part-3)

Another interesting feature of Object Oriented Programming is its inheritance. Inheritance inherits the behaviors or attributes from its parent or base classes. C++ uses virtual inheritance to overcome the inheritance ambiguity in multiple-inheritance. Inheritance ambiguity will occur when derived class object is…

MFC: CObject class (Part – 1)

CObject is the base class for almost all classes in Microsoft Foundation Class (MFC) library. A class is qualified as a MFC based class by deriving its from MFC’s base class CObject. Once the normal class is derived from CObject…

C++: Class Constructors

In C++, Class constructors are special kind of methods to instantiate a class. When class’s object is going to create, first C++ will call class’s constructor to initialize the class. Initialize the class means, assigning its members and allocating any…

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…

C++: Why virtual? (Part-2)

An interface is a contract between a caller and a callee. An interface doesn’t provide any implementation. It provides a blue-print. C++ uses virtual keyword to create an interface or an abstract class. Lets take an example: class IHello {…

C++: Why virtual? (Part-1)

C++ is a Object Oriented language. C++ uses virtial keyword for different places. One of this is in creating virtual functions. One of the Object Oriented feature is Polymorpishm which means multiple-behaviours. An object has multiple behaviours and it shows particular…

COM: Creating a COM Component using C++ (Part-3)

In series of articles on creating a COM Component using C++, in previous article, we have implemented a component using C++. The component implemented IUnknown standard interface and IHello custom interface. Custom interfaces are the interfaces defined by us. Standard interfaces are…

COM: Creating a COM Component using C++ (Part-1)

COM (Component Object Model) is a platform-independent, distributed and object-oriented technology developed by Microsoft to create re-usable software components and enables software components to communicate. COM enables interaction between objects through interfaces. Interfaces are core concepts to build COM components.…

C++: Pure Virtual functions

C++ Pure Virtual functions are used to create an abstract classes or interfaces. Pure Virtual functions have no function definition; just the function will be declared and the definition left to the derived classes. In C++, like Java, there is…

How to add or remove icons to taskbar in Windows 7?

Windows - Pin to Taskbar

Taskbar is useful to launch applications quickly. And also useful to monitor the running applications. Usually frequently used application icons will be placed in Taskbar. Window 7 Operating System allows the users to add or remove the application icons to/from…