Maybe it's a problem with Win32::API? You might try using Inline::C. The following code probably won't work (I don't have the library, and haven't tested the code anyway), but it may give you some ideas on how to approach this problem:
use Inline::C; $transbar = "\0"x66; $bardata = "3070202120200000000127203643012"; $rc =0; $track = substr($bardata,0,20) . "\0"; $route = substr($bardata,20,11) . "\0"; $rc = barcode($track,$route,$transbar); print "$transbar \n"; __C__ #include <windows.h> // setup our data structures typedef int (__cdecl *USPS4CB)(char *,char *,char *); HINSTANCE hDLL; USPS4CB lpfnUSPS4CB; //load the DLL hDLL = LoadLibrary("USPS4CB"); if (hDLL != NULL) { //get a pointer to the function we'll call lpfnUSPS4CB = (USPS4CB)GetProcAddress(hDLL, + "USPS4CB"); if (!lpfnUSPS4CB) // problem loading the function { FreeLibrary(hDLL); // here we would kill our perl process or something, cause // loading the library failed // I don't do too much of this, so I'm not quite sure // how to properly fail fatally } } // function for perl to call int barcode(char *track, char *route, char *transbar) { // call the function return lpfnUSPS4CB(track, route, transbar); }
Let me stress that I haven't tested that code, and it may not work. It's mainly just an idea on where I'd go if the Win32::API module isn't working. For example, if you don't have access to Inline::C, then this approach doesn't even have a chance of working.

In reply to Re: WIN32-API Purgetory by assemble
in thread WIN32-API Purgetory by jkretlow

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.