We are using the OPOS drivers v 1.11 in our Desktop application and now migrating it to v 1.14. The application is working fine with the newer version on x86 architecture but when compiled to x64 , it throws a runtime error for class not registered. The exception is encountered on the very first attempt to initialize a new instance of the object class. When called for new instance,
oPOSPOSPrinter = new OPOSPOSPrinter();
The exception thrown is,
System.Runtime.InteropServices.COMException
HResult=0x80040154
Message=Retrieving the COM class factory for component with CLSID {CCB90152-B81E-11D2-AB74-0040054C3719} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Source=mscorlib
The dlls we are refencing here is a 32 bit version & our application is compiled on 64 bit.
We tried to register it via regsvr32 tool but then it throws an exception there as well.
We tried to manually add it to the registry but it didn’t helped.
We tried with both the versions, one from the default OPOS installation directory & another from the OposFor.Net folder in the same directory.
So, we would like to ask for a solution as to how to achieve this? We want to migrate our application on x64 architecture and support all the current functionality from the OPOS v 1.11 on OPOS v 1.14. Also, will there be a 64-bit version of the OPOS drivers available in near future?
System & App Info: OS: Windows 10 Pro IDE: VS 2017, .Net Version: .Net 4 + OPOS dll Version: 1.14.001
64 Bit process cannot call a 32bit library directly in it's process. You need to have a different approach to talk to 32 Bit library.
Note: If the communication need to happen on the same machine (means your 64 Bit application and 32 Bit library is going to be in the same machine) in this case first two options will be the best work with.
Hope this info helps and can help you procees further.
Happy Coding...