I have been using Perl and the WIN32-API to encode data into barcode sequences that can be printed
I have over 100 barcode applications written using different barcoding DLLs from different barcode software venders.
The ActiveState PPM repository has two versions of the WIN32-API: 0.47 and 0.46
Programs working in Perl 5.8.7 using WIN32-API Version: 0.41 cause the newer releases to abort.
This encoder is a DLL.
http://ribbs.usps.gov/OneCodeSolution/
In the USPS sample C program the DLL is invoked this way
char TrackString[21];
char RouteString[12];
char BarString[66];
int RetCode;
__declspec (dllimport) int USPS4CB( char *TrackPtr, char *RoutePtr, ch
+ar *BarPtr);
The following Perl script works perfectly in Perl 5.8.7 using WIN32-API 0.41 but fails in newer releases
use Win32::API;
$dll = new Win32::API("USPS4CB","USPS4CB",[P,P,P],I);</span><br />
$transbar = "\0"x66;
$bardata = "3070202120200000000127203643012";
$rc =0;
$track = substr($bardata,0,20) . "\0";
$route = substr($bardata,20,11) . "\0";
$rc = $dll->Call($track,$route,$transbar);
$transbar =~ s/\0.*$//;
print "$transbar \n";
The ouput returned is:
ATTDAATFADDDTDDTFTFFADADFDTDDAFTATTAAATAAFTFADFDTTTFADAFDDATDDTFT
I no longer have a fully functional version of Perl 5.8.7 and have been unable to build one.
Can anyone tell me how to get this to work in the newer releases of Perl?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.