Problem instantiating object from custom ActiveX DLL

Discussion in 'ASP General' started by Marja Ribbers-de Vroed, Dec 16, 2005.

  1. 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?

    --
    Marja
    Marja Ribbers-de Vroed, Dec 16, 2005
    #1
    1. Advertising

  2. 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
    Marja Ribbers-de Vroed, Dec 16, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?SGFuZHkgTXVsaWE=?=

    Help!! Problem instantiating WORD object using C#.NET

    =?Utf-8?B?SGFuZHkgTXVsaWE=?=, May 31, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,394
    Rick Strahl [MVP]
    May 31, 2005
  2. Handy Mulia

    Help!! Problem instantiating WORD object using C#.NET

    Handy Mulia, May 31, 2005, in forum: ASP .Net Security
    Replies:
    2
    Views:
    246
    Dominick Baier [DevelopMentor]
    May 31, 2005
  3. Abhilash

    Instantiating VB DLL

    Abhilash, Aug 3, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    116
    Abhilash
    Aug 3, 2005
  4. Rahul Mittal
    Replies:
    1
    Views:
    216
    Victor Garcia Aprea [MVP]
    Oct 19, 2003
  5. cb

    instantiating the ASP.DLL

    cb, Jul 18, 2003, in forum: ASP General
    Replies:
    2
    Views:
    137
    Mark Schupp
    Jul 21, 2003
Loading...

Share This Page