What would be equivalent in C / C ++?
This is the function CoCreateInstance () .
It is convenient to use CoCreateInstance when you need to create only one instance of an object on the local machine. if you are creating an instance on a remote computer, call CoCreateInstanceEx. When you create several cases, it is more efficient to get a pointer to an object of the IClassFactory Interface class and use it if necessary. In the latter case, you should use the CoGetClassObject function.
You will need #include <Objbase.h> and you will need to set the link to ole32.lib
Only two calls. You need CLSIDFromProgID () to map the argument that you usually pass CreateObject to the CLSID. Which you can then use in CoCreateInstance ().
Remember to call CoInitializeEx or CoInitialize before CoCreateInstance