'System.Runtime.InteropServices.COMException' in Interop.ZKFPEngXControl.dll (0x80040202)

1

I am developing a winform fingerprint reader application using ZKFinger SDK.
When i am running following code:

ZKFPEngXClass obj = new ZKFPEngXClass();
obj.OnImageReceived += Obj_OnImageReceived;
obj.OnCapture += Obj_OnCapture;
obj.OnEnroll += Obj_OnEnroll;
obj.OnFeatureInfo += Obj_OnFeatureInfo;

then i get error on

 obj.OnCapture += Obj_OnCapture;
 obj.OnEnroll += Obj_OnEnroll;
 obj.OnFeatureInfo += Obj_OnFeatureInfo;

but

obj.OnImageReceived += Obj_OnImageReceived;

works fine.

Error is

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Interop.ZKFPEngXControl.dll".
Additional information: Exception from HRESULT: 0x80040202

c#
.net
visual-studio
sdk
fingerprint
asked on Stack Overflow Dec 19, 2016 by AMAR MATHUR • edited Dec 19, 2016 by LaurentY

2 Answers

0

You should register those events only after you connect to the device.

        if (objCZKEM.Connect_Net(IPAdd, Port))
        {
            //65535 or 32767- depends
            if (objCZKEM.RegEvent(1, 32767))
            {
                // [ Register your events here ]
                // [ Go through the _IZKEMEvents_Event class for a Ex);
            }
            return true;
        }
answered on Stack Overflow Dec 19, 2016 by Ozesh
0

Instead of using

ZKFPEngXClass obj = new ZKFPEngXClass();

use

ZKFPEngXControl.ZKFPEngX obj = new ZKFPEngXControl.ZKFPEngX();

Hope it helps.

answered on Stack Overflow Aug 14, 2017 by AHeine

User contributions licensed under CC BY-SA 3.0