An easy to understand guide on how to generate barcode with barcode sdk in C++ with this source code sample. Want to generate barcode with barcode sdk in your C++ app? ByteScout Barcode Suite is designed for it. ByteScout Barcode Suite is the bundle that privides 3 SDK products to generate barcodes (Barcode SDK), read barcodes (Barcode Reaer SDK) and read and write spreadsheets (Spreadsheet SDK).
The SDK samples given below describe how to quickly make your application do generate barcode with barcode sdk in C++ with the help of ByteScout Barcode Suite. Simply copy and paste in your C++ project or application you and then run your app! Check C++ sample code samples to see if they respond to your needs and requirements for the project.
Trial version of ByteScout Barcode Suite is available for free. Source code samples are included to help you with your C++ app.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
#include "stdafx.h" #import "Bytescout.BarCode.tlb" raw_interfaces_only using namespace Bytescout_BarCode; int _tmain(int argc, _TCHAR* argv[]) { // Initialize COM. HRESULT hr = CoInitialize(NULL); // Create the interface pointer. IBarcodePtr pIBarcode(__uuidof(Barcode)); // set the registration name and key BSTR regname = ::SysAllocString(L"DEMO"); pIBarcode->put_RegistrationName(regname); ::SysFreeString(regname); BSTR regkey = ::SysAllocString(L"DEMO"); pIBarcode->put_RegistrationKey(regkey); ::SysFreeString(regkey); // Set barcode type (symbology) pIBarcode->put_Symbology(SymbologyType_Code128); // Set barcode value BSTR value = ::SysAllocString(L"Abc123"); pIBarcode->put_Value(value); ::SysFreeString(value); // Save barcode image BSTR fileName = ::SysAllocString(L"result.png"); pIBarcode->SaveImage(fileName); ::SysFreeString(fileName); pIBarcode->Release(); // Uninitialize COM. CoUninitialize(); return 0; }
60 Day Free Trial or Visit ByteScout Barcode Suite Home Page
Explore ByteScout Barcode Suite Documentation
Explore Samples
Sign Up for ByteScout Barcode Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
// stdafx.cpp : source file that includes just the standard includes // BarcodeGenerationExample.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file
60 Day Free Trial or Visit ByteScout Barcode Suite Home Page
Explore ByteScout Barcode Suite Documentation
Explore Samples
Sign Up for ByteScout Barcode Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once #include "targetver.h" #include <stdio.h> #include <tchar.h> // TODO: reference additional headers your program requires here
60 Day Free Trial or Visit ByteScout Barcode Suite Home Page
Explore ByteScout Barcode Suite Documentation
Explore Samples
Sign Up for ByteScout Barcode Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
#pragma once // Including SDKDDKVer.h defines the highest available Windows platform. // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. #include <SDKDDKVer.h>
60 Day Free Trial or Visit ByteScout Barcode Suite Home Page
Explore ByteScout Barcode Suite Documentation
Explore Samples
Sign Up for ByteScout Barcode Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout Barcode Suite Home Page
Explore ByteScout Barcode Suite Documentation
Explore Samples
Sign Up for ByteScout Barcode Suite Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: