Click here to Skip to main content
16,021,293 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I’m currently working on a UWP app to work with scanners. This application is a POS app and reads barcodes. Windows 10 Provides its built in barcode scanner class. That is used for UWP apps but it is limited in functionalities. you can check it here.

Window 10 barcode Scanner for UWP < Available in Creaters Update only >

further! we are supposed to use SNAPI protocol with barcode scanning in our app. So instead of working with built in .NET class we proceeded with 3rd Party Barcode Scanner SDK, which provides us the SNAPI Protocol in its Code. It is a COM based API. You can check it here.

Zebra Scanner SDK for Windows

This SDK is very old. It works fine with older .NET platforms like Winforms and WPF etc. but I'm unable to consume its services from UWP app.
We want to use This COM based API in our UWP app, but we are unable to find a way to consume it from UWP. Is there a way to use COM based APIs in UWP apps?

What I have tried:

we tried to make WCF Services instead, to consume 3rd party SDK indirectly but this is a heavy solution of a large problem and it increases code complexity as well.
I also used PCL ( Portable class library ) to consume that API from UWP but PCL is also not able to access COM based APIs.
This is problem that on I’ve been stuck from few days, couldn’t find any appropriate solution on Internet as well.
Posted
Updated 29-Aug-17 7:12am
v3

1 solution

Some COM components work in UWP apps, most don't. Why?

UWP applications run in a "sandbox" where the application needs permissions to do just about anything. They are restricted to using a limited subset of the Win32 and COM API's. Most existing COM components, unless they are explicitly written for UWP, will not work because they call API's that don't exist or are not available in the restricted sandbox.

Because of it's "universal" nature, not all platforms can handle COM or can really have any COM support, like Windows Phone. That's why you really don't have a good solution for using COM components in UWP.

You can try going through this[^] article. It's for Windows 8, but it still applies to Win10. Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900