Link OS SDK C++ Samples

I have an MFC C++ application to which I need to add functionality to print QR codes to a ZT610 printer. I have the Link-OS SDK but this does not seem to support C++, am I missing something? If so are there any C++ code samples?

If the Link-OS SDK does not support C++ (in particular integration with an MFC application) is there a better option?

Thanks

Anonymous (not verified)
Unfortunately, the Link-OS

Unfortunately, the Link-OS SDK package doesn't support C++, so there is no C++ sample code. Link-OS SDK is designed to support Windows, Android and iOS platforms. Depending on how we architect the solution, there are a number of options. The MFC C++ application would run on Windows. Then we could use Link-OS SDK to create a sever on Windows that talks to MFC C++ application and print labels from the server. Alternatively, we could connect the C++ application directly to the printer, either through networking or USB, and then send ZPL to the printer.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Robert Build
Thank you, that is excellent

Thank you, that is excellent information.

The MFC application is on Windows, developed using Visual Studio. Is there example code available for connecting directly to the printer via USB and sending ZPL to the printer. This would be for QR codes.

Thanks again!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
We don't have example code in

We don't have example code in C++ for connecting to USB. You may Google it. The Visual Studio should have USB library already. The Link-OS SDK documentation may provide you some reference on using the USB. You may want to check out the PC-.NET Documention for reference.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Robert Build
Perhaps I misunderstood, when

Perhaps I misunderstood, when you wrote "Alternatively, we could connect the C++ application directly to the printer, either through networking or USB, and then send ZPL to the printer", I assumed there were examples for this.

Are there any examples of sending ZPL directly to the printer?


Thanks!

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
ZPL is of text strings that

ZPL is of text strings that comply with ZPL Programming Guide. Once we have a connection, either a USB connection or a TCP connection, we simply follow the write operation, as defined by USB or TCP, to send the text strings to the printer. The USB library on Visual Studio should have the details on how to write/read data to/from USB.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Robert, We have a few

Hi Robert, We have a few samples of network printing with C++ on our old Knowledge Base site.  We're moving this content soon, but it's still running. Zebra Technologies - Results The code is basically opening a standard TCP socket to port 9100 and sending ZPL.  If you don't know ZPL, you can use a design tool or a print driver as below.

For USB, It's MUCH harder to make a direct connection to a USB device of any sort.  You are better off working with a print driver either by sending a Zebra driver an image you want to print, or setting up a Generic Text driver and sending raw ZPL to it. Microsoft Sample/Documentation for Driver Printing​. 

If you are intent on working with a direct connection, I can share some C# sample using native Windows API's. It should convert to C++, but I warn you that it is complicated to do this.  There may be other options such as Browser Print that could do the job as well.

If you let us know what direction you want to go we will see if we can point you to more specific samples. 

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Massimiliano Ca...
Hello Mrs. West,would it be

Hello Mrs. West,

would it be possible for you to post (or send to my email mcavicchioli@halcyongallery.com) some working examples of .NET code (either ASP or C#) for printing 2D QR images on a Zebra GK420D?

Thanks in advance,

Massi.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Stephen Troup
Depending on how willing you

Depending on how willing you are to dig into the c++ and c# you can use .net assemblies within a c++/cli bridging project. I've looked at something similar recently.

Mixed (Native and Managed) Assemblies | Microsoft Docs

Native and .NET Interoperability | Microsoft Docs

Break the code down to the point where it's only one or two calls to the managed code that exposes it to the rest of the project.

https://www.experts-exchange.com/questions/28549337/How-can-I-call-a-managed-CLR-C-routine-from-unmanaged-C.html

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments