Cannot use EMDK for .NET.

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

I use the Symbol.dll and Symbol.barcode2.dll libraries to use a barcode scanner. But I get errors when I run the code on the emulator using Windows Mobile 6.5.

the code:

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

An exception:

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

Do I need another emulator or something else?

thanks

+6
source share
2 answers

AFAIK, SCNAPI32.dll is a native dll that is present on Motorola devices (loaded from ROM) and is called using the dll character. The emulator is not a Motorola device, so it does not have these libraries. If the device has a USB cable, you can connect it using ActiveSync (or the Windows Mobility Center) and debug the device itself; I do not know if motorola has any emulators.

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

+10
source

I had a similar problem with Symbol and Symbol.Audio. My error message was

Cannot find PInvoke dll 'Audioapi32.dll'

It turns out that there are simulated modes for some Symbol devices. Motorola Symbol libraries detect these modes using a device registry 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 that the simulation is not set to "Never" in

[HKEY_LOCAL_MACHINE \ Software \ Symbol]

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

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

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

+3
source

Source: https://habr.com/ru/post/899333/


All Articles