C++ – Operator Overloading
One of the beautiful feature of ‘C++’ is it’s ability to support Operator Overloading. ‘C++’ Operator Overloading allows to change the behavior of operators when...
C Programming – How to pass variable number of arguments to C / C++ functions?
C/C++ allows to pass variable number of arguments to its functions through variable argument list (va_list). C/C++ provides a series of macros/functions va_start, va_arg, va_end...
C++ – Inheritance – to extend class
Inheritance allows to reuse the functionality. Inheritance inherits base class members to it’s derived class. We can use base class members within the derived class...
COM – Creating a COM Component using C++ – Add Type Library to Visual Basic Application
In our previous article, we have created Type Library “Hello.tlb”. We were facing issues when we tried to add “HelloComponent.dll” as a reference to our...
COM – Creating a COM Component using C++ – Generate a Type Library
We have created our COM component using C++ and we have tested our COM component in C++ based client application. We found that our COM...
COM – Creating a COM Component using C++ – Summary of component development
Finally we have successfully developed our COM component HelloComponent using C++. Lets summarize how we developed our COM component in this article. Microsoft’s Component Object Model (COM)...
C++: Templates
C++ Templates are used for writing generic programming. C++ allows to define function templates and class templates. In C++, we use template keyword to write...
COM – Creating a COM Component using C++ – IClassFactory implementation
CoCreateInstance is depends on IClassFactory to create class instances. We have looked into IClassFactory‘s methods and we have implemented these methods in our previous article. Lets include...
COM – Creating a COM Component using C++ – IClassFactory
In our previous article, we have identified that CoCreateFunction is requesting an instance of IClassFactory. Why CoCreateInstance is requesting an instance of IClassFactory? One of the goal of...
COM – Creating a COM Component using C++ – Inside CoCreateInstance
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...
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...
COM – Creating a COM Component using C++ – .def file
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...
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...
COM – Creating a COM Component using C++ – CoCreateInstance
As of now we have created our COM component. Now it is the time to test our component. In this article we are going to...
C++ – Calling Virtual functions from class Constructors
Virtual keyword in C++ is used for polymorphic behavior. C++ allows to create virtual functions, virtual destructors and virtual inheritance. Virtual functions will resolve exact...
C++ – Multiple Inheritance – Virtual inheritance to overcome inheritance ambiguity
Another interesting feature of Object Oriented Programming is it’s inheritance. Inheritance inherits the behavior or attributes from it’s parent or base classes to the derived...
C++ – Class Constructors
In C++, class constructors are special kind of methods to instantiate a class. When class’s object is going to create, C++ will first call class’s...
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...
C++ – How to create an interface or an abstract class?
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...
COM – Creating a COM Component using C++ – Registering a COM component
In our previous article we have packaged a component into a DLL. Now we will look how to register the component. Registering a COM component...