The format specifier does not match the type of the argument you're giving to it.
Format specifier %s is used to print a null-terminated string. Your chBarcode variable is declared as a CHAR array, and pchTesto is a BYTE pointer. It seems that you want to concatenate the chBarcode string to the pchTesto string -
Standard C Library/Functions/printf[
^].
Try the adding '%s' to your code -
sprintf_s((char *)pchBuffOut + 2, nbytes + nLenBarcode + 1, "%s%s", (char *)pchTesto, chBarcode);