I'm maintaining some legacy code that doesn't seem to work correctly...
An ActiveX dll was created a while ago in VB6 to process some data in the database. This dll is imported into a VC++ (visual studio .net 2003) project with the #import directive, but when it attempts to create an instance of this (CreateInstance smart-pointer), it always returns a null. While debugging into the CreateProcess (comip.h), CoCreateInstance returns "Class not registered".
I checked the registry, the keys are correct (guid, InprocServer32, ProgID), I create a separate vb6 exe, references the dll correctly.
Do I need to change the way the dll is being imported?
[tt]
CODE
----
#import "\projects\DBProcess\DBProcess.dll"
...
DBProcess::_ClassProcessPtr pDBP;
pDBP.CreateInstance("DBProcess.ClassProcess");
//pointer is null
...
[/tt]
-----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook
An ActiveX dll was created a while ago in VB6 to process some data in the database. This dll is imported into a VC++ (visual studio .net 2003) project with the #import directive, but when it attempts to create an instance of this (CreateInstance smart-pointer), it always returns a null. While debugging into the CreateProcess (comip.h), CoCreateInstance returns "Class not registered".
I checked the registry, the keys are correct (guid, InprocServer32, ProgID), I create a separate vb6 exe, references the dll correctly.
Do I need to change the way the dll is being imported?
[tt]
CODE
----
#import "\projects\DBProcess\DBProcess.dll"
...
DBProcess::_ClassProcessPtr pDBP;
pDBP.CreateInstance("DBProcess.ClassProcess");
//pointer is null
...
[/tt]
-----------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rich Cook