VC ++: Help Create a Simple COM Class
If you are using "raw C ++", there is an incredible amount of tedious detail you need to take care of, even for a simple base COM class. The easiest way to create a COM callable class in C ++ is ATL, which even comes with a wizard (at least in VS 2005 and 2008) for this purpose. The wizard will spit out a perfectly useful component including a reference count, registration, and one user interface. Keep in mind that VB uses late binding, so you need to implement IDispatch
in your class (you can use ATL IDispatchImpl
to make your life easier).
BTW, ATL gives you a very small footprint (it's a templating library) - just a VC ++ runtime, so there aren't many dependencies.
a source to share