C++ COM Object can be instantiated using NEW in VB but not using CreateObject()
Posted on 2004-09-23
Dear all experts,
I managed to create an ATL COM dll in VC.NET 2003. So far it works and registers as designed. Handy Dandy.
Now I tried testing the dll in VB (6) using this code:
Dim a As New DecodeKL
MsgBox (a.GetApplicationCode(1234, "5678"))
However this approcach:
set a = CreateObject("DecodeKL")
results in "ActiveX Component can't create object".
I know I must be missing something obvious in the creation of my interface and CoClass - I just don't find it.
Here's how I started this project:
New ATL Project
Add Class -> ATL Simple Object
On the Interface it created "Add Method"
and then fill the method with code.
What am I missing?