As far as getting started goes, I highly recommend you check out A Beginner Tutorial for Writing Simple COM/ATL DLL and Using it with .NET by ThatsAlok.
I've tried a number of different techniques in creating ActiveX objects, and, I found the ATL C++ to be one of my favourites. The key essentials of the tutorial are:
- Utilizing Visual Studio ATL Simple Object wizard
- Naming the interface in C++ (e.g.
ISimpleCom
)
- Choosing a progid (e.g.
SimpleATLcom.SimpleCom
)
- Letting Visual Studio generate as much code for you as possible
- Registering your COM DLL
Some things the tutorial doesn't cover is:
The latter, you already know how to do that, but, for completeness. In JScript, it's:
var obj = new ActiveXObject("SimpleATLcom.SimpleCom");
And, in VBScript, it's:
Dim obj
Set obj = CreateObject("SimpleATLcom.SimpleCom")