COMException error. Use DLL - Type Mismatch

0

Friends Good afternoon! Please help her with the following.

I have been given a DLL which I have no idea what language was programmed and I'm not sure it's an object to use in .NET environments. This dll is encrypted, but the idea is to use a function which is in it. This function is defined as follows:

Validate (String PW, ref String EncrPW, ref String Status);

When invoked in the following way:

        try
        {
            ODBMSSecEncr D = new ODBMSSecEncr();
            D.Validate("mflores",ref EncrPW, ref Status);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.StackTrace);
        }

Throw the following error:

ErrorCode: -2146828275 Message: Type mismatch StackTrace: in ODBMSSec._ODBMSSecEncr.Validate (String PW, String & EncrPW, String & Status)    in ControlInsumos.Global.Application_Start (Object sender, EventArgs e) in C: \ Users \ JADM \ Documents \ Visual Studio 2010 \ Projects \ ControlInsumos \ ControlInsumos \ Global.asax.cs: line 32

Please help with this! Thanks in advance.

Greetings.

    
asked by Manuel Flores 06.05.2016 в 20:07
source

1 answer

1

It's probably a DLL that you have to register with Regsvr32

Try to do this:

  • If your PC is 32 bits
  • Copy the DLL to the folder: ** C: \ Windows \ SysWoW64 **

    Then run this on the cmd (with admin privileges) % windir% \ SysWoW64 \ regsvr32.exe% windir% \ SysWoW64 \ name_of_your_dll.dll

  • If your PC is 64 bits
  • Copy the DLL to the folder: ** C: \ Windows \ System32 **

    Then run this on the cmd (with admin privileges) % windir% \ System32 \ regsvr32.exe% windir% \ System32 \ your_dll.dll_name

    Luck.

        
    answered by 12.05.2016 в 23:50