Does OPOS works only for x86 .NET applications?

319 Views Asked by At

I was trying to interface with OPOS interface a DataLogic-QuickScan-QD2131 handheld scanner using the following code:

class Program 
{
    static OposScanner_CCO.OPOSScanner scanner;

    static void Main(string[] args)
    {
        scanner = new OposScanner_CCO.OPOSScanner();
        scanner.Open("USBHHScanner");
        scanner.ClaimDevice(1000);

        if (scanner.Claimed)
        {
            Console.WriteLine("Claimed succesfully");
            scanner.DeviceEnabled = true;
            scanner.DataEventEnabled = true;
            scanner.DecodeData = true;
            scanner.FreezeEvents = false;
            scanner.DataEvent += Scanner_DataEvent;
        }
        Console.ReadKey();
    }

    private static void Scanner_DataEvent(int Status)
    {
        Console.WriteLine("Scanned {0}", Status);
    }
}

When I'm compiling this program targeting "Any CPU" this wouldn't work, throwing exception at the first line of Main:

System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {CCB90182-B81E-11D2-AB74-0040054C3719} failed due to the following error: 80040154 Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)).

But when compiles to x86 it sort of working.

Thanks in advance!

1

There are 1 best solutions below

1
On

Historically, most OPOS works only in 32-bit mode.

It was the time when OPOS was born without 64-bit mode, the Common CO was created only for 32bit, and many of the OPOS service objects are still created in VC++, etc. It is influencing.

It seems that some vendors create 64-bit CO based on the Common CO source code, and at the same time create and combine 64-bit SO to support 64-bit mode, but that is only a proprietary offer. Probably.


Mr. Curtiss Monroe, who was in charge of development, update and maintenance of Common CO, has stopped updating UnifiedPOS(OPOS) after v1.14.1.
Monroe Consulting Services
The Common CO up to that version is provided only in 32-bit mode.

Therefore, I am updating the Common CO for both 32bit/64bit environments based on the Common CO source from UnifiedPOS(OPOS) v1.15.
kunif/OPOS-CCO
So far, it has been recognized by the OPOS-J Technical Council in Japan.


Various data registered in the registry are important in the COM environment, but they are separated in the 32-bit environment and the 64-bit environment.
If you do not take special care in the program, you will not be able to cooperate with each other in 32bit/64bit.

Therefore, in order to use OPOS in a 64-bit environment, it is necessary for the device vendor to create and provide a service object for the 64-bit environment.

Even in that case, each component of 32bit/64bit cannot be mixed in one program.
Mixing 32bit/64bit in one program will require all applications/CO/SO to deal with it.
It's unrealistic.


For that reason, until now only OPOS that operates in 32-bit mode has been offered.

Until the vendor of each device accepts my (or someone else's) 64-bit Common CO and provides a service object for 64-bit mode, OPOS will not change the situation where it only works in 32-bit mode.