Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to use EMDK for .NET

I'm developing a mobile application that uses a barcode scanner (Motorola MC75A). I installed EMDK for .NET v2.5.

I use the libraries Symbol.dll and Symbol.barcode2.dll for use of the barcode scanner. But I get errors when I run the code on the emulator device with Windows Mobile 6.5.

Code:

Barcode2 myBarcode2 = null;
Device MyDevice = SelectDevice.Select(
"Barcode",Symbol.Barcode2.Devices.SupportedDevices);// Exception here

Exception:

{"Can't find PInvoke DLL 'SCNAPI32.dll'."}

do I need another emulator or something else?

Thanks

like image 282
eicruzado Avatar asked Oct 14 '11 21:10

eicruzado


2 Answers

AFAIK, SCNAPI32.dll is a native dll, which is present on motorola devices (loaded from ROM) and called by the Symbol dll's. The emulator is not a motorola device so it does not have these libraries installed. If the device has an USB cable you could hook it up using ActiveSync (or windows mobility center) and debug on the device itself; I don't know if motorola has any emulators.

If you really need to test the application using the default emulator, you could create an empty Symbol.dll and Symbol.barcode2.dll, recreate the same interface as Symbol's and debug using those. Instead of activating a scanner you could then Console.WriteLine("Scanner activated"); etc.

like image 57
C.Evenhuis Avatar answered Nov 16 '22 02:11

C.Evenhuis


I ran into a similar problem with Symbol & Symbol.Audio. My error message was

Can't find PInvoke DLL 'AudioAPI32.dll'

It turns out there are simulated modes for some Symbol "devices". Motorola Symbol libraries detect those modes using registry of the device or emulator. To access the Emulator registry, you can use Visual Studio Remote Tools \ Remote Registry Editor

Then just connect to your emulator (Windows Mobile 6.5.3 Professional Emulator), and make sure there's no Simulation value as 'Never' in

[HKEY_LOCAL_MACHINE\Software\Symbol]

If there is no Simulation-string value, the default is probably Auto - in which case the emulator asks which mode you want to use. You can also try adding Simulation as 'Always'.

You could also add checks to see if devices are available, for example:

if (Symbol.Barcode.Device.AvailableDevices == null) return;

like image 29
Mikko Junnila Avatar answered Nov 16 '22 03:11

Mikko Junnila