The conventional way to load/create ActiveX control is to do it in the Resource Editor, 'Insert ActiveX Control', and the MFC ClassWizard will generate all the .cpp/.h files.

What if I have an ActiveX control registered in my system, and I want to dynamically create and run it in my dialog-based MFC application, at runtime? Should I use CreateControl or CoCreateInstance? Can someone post a simple code snipplet on how to achieve this? Thanks in advance.