Problem instantiating object from custom ActiveX DLL

  • Thread starter Marja Ribbers-de Vroed
  • Start date
M

Marja Ribbers-de Vroed

I've been provided with a custom ActiveX DLL (written in C++) that reads a certiifcate to generate a signature for a passed XML string, and I'm having trouble instantiating it.
The DLL is registered succesfully on my computer and I've explicitly granted IUSR_<machinename> to use it.

The DLL comes with a testtool (written in Visual Basic) which instantiates the object like this:

Dim loCertCryptCOM As New CCOMCRYPTLib.CCrypt

As you can see, this testtool uses "CCOMCRYPTLib.CCrypt" to instantiate the object from the DLL.

However, if I try to do the same from my ASP/VBscript application, like this:

Set l_oCertCrypt = Server.Createobject("CCOMCRYPTLib.CCrypt")

I get an "Server.CreateObject Failed. Invalid Class string" error.

I also have the C++ sources for this DLL and browsing those, I saw that the ProgID for the DLL is "CComCrypt.CCrypt" which puzzles me, since the VB-application uses something else for the instantiation.

To test, I tried instantiating the object like this:

Set l_oCertCrypt = Server.Createobject("CComCrypt.CCrypt")

and it seems to work, except that the function call that I need to trigger is not recognised then (error: Type mismatch: 'l_oCertCrypt.CreateHash').

It seems strange that the Visual Basis application is successfull in instantiating an object that I can't instantiate from my ASP/VBscript webapplication.
And the Visual Basic application has no problem triggering the CreateHash() method, and I can't get that working.

Any ideas what I might be doing wrong here?
 
M

Marja Ribbers-de Vroed

I still don't understand why I need to instantiate another object in my ASP/VBscript application than the Visual Basic application needs to do, but I did find a probable cause for my problem.

For those of you who are interested:
The object's method is defined in de DLL to expect 5 parameters: 2 in and 3 out.
The 3 out parameters are declared as [out] parameters (that is, by reference) and they are declared as type 'string' while they should be declared as type 'variant' to be used from ASP.
(see: http://support.microsoft.com/kb/197957/EN-US/)

I do have the C++ sources of the DLL as well, so I will try to change this and see what happens then.

Regards, Marja
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top