Unable to use EMDK for .NET

11,499

Solution 1

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.

Solution 2

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;

Share:
11,499
eicruzado
Author by

eicruzado

Updated on June 13, 2022

Comments

  • eicruzado
    eicruzado about 2 years

    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

  • eicruzado
    eicruzado over 12 years
    I add the Simulation value but I still get the error. I guess the unique way to test the code is debugging with the device. Tnanks for the answer.
  • Geoff
    Geoff almost 12 years
    Setting the simulation value to 'Always' worked for me, although now it's continuously firing read events...