问题
I am following this tutorial (https://atgsupportcentral.motorolasolutions.com/content/emb/docs/manuals/14978403a.pdf), created a simple Windows Forms and successfully can debug it on the scanner (it's a Symbol MC3000).
However I am getting an exception when trying to initialize the CCoreScannerClass:
//Instantiate CoreScanner Class
CCoreScannerClass cCoreScannerClass = new CoreScanner.CCoreScannerClass();
The exact error message is this:
"COM object with CLSID '{9F8D4F16-0F61-4A38-98B3-1F6F80F11C87}' cannot be created due to the following error: 0x80040154."
Can anyone please provide some help? Since it's a COM exception, I assume it's because the class is not registered? Any ideas on how to fix this?
Many thanks.
回答1:
I got it working by downloading the EMDK for .NET from the Motorola's website:
https://portal.motorolasolutions.com/Support/US-EN/Resolution?solutionId=88177&productDetailGUID=f5563b1ca4151410VgnVCM10000001c7b00aRCRD&detailChannelGUID=a0bde8cea8151410VgnVCM10000001c7b00aRCRD
回答2:
0x80040154
is an error that, as you mentioned, pertains to the COM class not being registered, which means that COM couldn't find the class factory in the Windows registry. You can use C:\Windows\system32\regsvr32
to register the missing SDK DLL.
回答3:
I got it working after the installation of the Scanner Management Service https://portal.motorolasolutions.com/Support/US-EN/Resolution?solutionId=87864&productDetailGUID=f0acd085364cf310VgnVCM10000081c7b10aRCRD&detailChannelGUID=84a76e203763e310VgnVCM1000000389bd0aRCRD
来源:https://stackoverflow.com/questions/25440900/wince-barcode-scanner-com-exception-when-initializing-ccorescannerclass