Search code examples
c#.netwindows-mobile-5.0intermec

CN3 barcodereader and imager fails when connected to internet


Im using an intermec CN3 device with windows mobile 5 on and trying to use the barcodereader and imager.

The itcscan.dll and imager.dll files cannot be found when connected to the internet. Please note that they work perfectly while not connected to the internet.

I get the following error for the barcodereader: "Cant find PInvoke DLL 'ITCScan.DLL'". And this is the error I get for the Imager: "Can not open Imager".

There is a lot of posts on the web about the cannot find pinvoke error but none of the ones I found are specific to being connected to the internet and the people from those posts seem to have it failing even when offline.

They fail on the new statements:

global var: Intermec.DataCollection.BarcodeReader barRead;

if (barRead == null)
{
    barRead = new Intermec.DataCollection.BarcodeReader();

The imager is similar with its own global var

img = new Intermec.DataCollection.Imager(PictureImager, Imager.PictureResolutionSize.Sixteenth);

There are some settings being set afterwards but it never passes these statements while connected to the internet.


Solution

  • It ended up being a memory issue. While connected to the internet the device was using up a bit more memory and this seemed to tip it over the edge.

    The problem that took it to the edge in the first place was a connection with a sql server ce on the device itself. It appears that the last sqlconnection never leaves memory even if you close it and force gc.collect. A strange workaround is simply to close and re-open then close it again to make the last connection really small in memory.

    Pretty sure this is a bug either with .Net framework or the sqlserver.