C++ COM Object can be instantiated using NEW in VB but not using CreateObject()

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?

Thanks, Nick
nick601Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
drichardsConnect With a Mentor Commented:
The registered ProgID is usually <ProjectName>.<ComponentName>, so check the registry for <name>.DecodeKL where <name> is the name of the project which contains teh COM object.
0
 
nick601Author Commented:
I should add that I need to be able to use CreateObject() because this dll is meant for use on an ASP web server. So NEW is not an option there.

Nick
0
 
drichardsCommented:
'new' works because you have evidently referenced the COM dll in your VB and it knows where to look.
0
 
nick601Author Commented:
As I said - something obvious - thanks DRichards!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.