0

I am having a problem. I have a Winform that I have developed to work with a fingerprint reader.

So when I use the dll for handling the fingerprint reader, I do the following:

1) I create a reference to the dll

enter image description here

2) I then add the using statement to use the namespace

enter image description here

3) I then create a ZKFPEngX object

enter image description here

4) Then I create an instance of that object and start making use of that instance.

enter image description here

In Debug mode in my Dev environment, this works perfectly.

Once I have packaged it and installed the program on another pc, it breaks as soon as it reaches a any section of code that makes use of that dll.

The error I get is:

enter image description here

I have made sure that the output includes the dll and when installed has the dll in the application directory.

I am not sure where to look from here for the error.

EDIT:

I have tried to register the dll just manually by copying the dll to System32, then trying to register the dll using regsvr32.exe

    regsvr interop.ZKFPEngControlX.dll

this throws the following error

enter image description here

I did try register another dll that was in the system32 file... that one worked like a charm

After further reading up, "the internet" suggests that the dll doesn't need to be registered, or rather cant be.

My question is how do I use it now, and why would it work in my dev environment?

  • 2
    Its been years, but don't you have to register com dlls ? – TheGeneral Aug 03 '18 at 07:44
  • You have to register the COM dll I'm pretty sure. Even your error message seems to indicate as much – pinkfloydx33 Aug 03 '18 at 07:45
  • @TheGeneral, yep `regsvr32`. – Drag and Drop Aug 03 '18 at 07:45
  • 1
    And don't get trick by the name on a 64 bit os the regsvr32 is 64 version. – Drag and Drop Aug 03 '18 at 07:46
  • 1
    You did something on your machine to have this component available, typically by running the vendor's installer. Do the same thing on the target machine. There are ways to simplify this, but you must know a lot more about the component itself. Never do anything rash like randomly running regsvr32 or regasm, that can do a lot of damage that is hard to repair. Look in the vendor's manual for deployment instructions or contact him for support. – Hans Passant Aug 03 '18 at 10:55
  • This is not a duplicate question because the above sugested duplicate q. is very old and general. – Siyon DP Aug 06 '18 at 14:43

1 Answers1

2

I could be wrong, however it just seems like the DLL isnt registered

Regsvr32 is a command-line utility to register and unregister OLE controls, such as DLLs and ActiveX controls in the Windows Registry. Regsvr32.exe is installed in the %systemroot%\System32 folder in Windows XP and later versions of Windows.

Regsvr32 [/u] [/n] [/i[:cmdline]] <dllname>

  • /u - Unregister server

  • /i - Call DllInstall passing it an optional [cmdline]; when it is used with /u, it calls dll uninstall

  • /n - do not call DllRegisterServer; this option must be used with /i

  • /s – Silent; display no message boxes

Further Reading

How to use the Regsvr32 tool and troubleshoot Regsvr32 error messages

TheGeneral
  • 79,002
  • 9
  • 103
  • 141
  • There *might* also be a way to write a manifest file so that one won't need to register the DLL if it's in the same folder. I don't remember the details, but I thought I would leave some keywords here for OP to look for the docs, if he feels like. – s.m. Aug 03 '18 at 08:54
  • @s.m. thanks for that, and worthy note – TheGeneral Aug 03 '18 at 08:54
  • @TheGeneral I have tried to register the dll manually... please see my edit – Stuart Black Aug 03 '18 at 09:52
  • @s.m. Noted.... will make use of those keywords and give that a go – Stuart Black Aug 03 '18 at 09:54