I have functions inside "some.dll" with the following 'C' specifications:

int ace_init(void);

int ace_term(void);

int ace_init_addr(one parameter); ADDR_HANDLE* ah; Output: address handle

int ace_set_file(three parameters);
ADDR_HANDLE ah; Input: address handle
int file_ID; Input: file identifier
char* pathname; Input: pathname



So far I have:
use Win32::API; my $debug = 1; ## Needed Files my $ADDRLN = 'c:\pw\acelib\addrln.dct'; my $LASTLN = 'c:\pw\acelib\lastln.dct'; my $PWCAS = 'c:\pw\acelib\pwcas.dct'; my $FIRMLN = 'c:\pw\acelib\firmln.dct'; my $CITY07 = 'h:\city07.dir'; my $REVZIP4 = 'h:\revzip4.dir'; my $ZCF07 = 'h:\zcf07.dir'; my $ZIP4US = 'h:\zip4us.dir'; my $ACE3553 = 'c:\pw\acelib\ace3553.frm'; my $ACENDI = 'c:\pw\acelib\acendi.frm'; my $ACELIBKEY = 'c:\pw\acelib\acelib.key'; my $ace_dll = 'c:\pw\acelib\ace32.dll'; ## ACE32 Functions my $ace_init = new Win32::API("$ace_dll", "ace_init", [V], I); my $ace_term = new Win32::API("$ace_dll", "ace_term", [V], I); my $ace_init_addr = new Win32::API("$ace_dll", "ace_init_addr", [P], I +); my $ace_term_addr = new Win32::API("$ace_dll", "ace_term_addr", [P], I +); my $ace_open = new Win32::API("$ace_dll", "ace_open", [P], I); my $ace_close = new Win32::API("$ace_dll", "ace_close", [P], I); my $ace_set_file = new Win32::API("$ace_dll", "ace_set_file", [P, I, P +], I); my $ah = pack('L', 0); my $addrln_path = pack('Z', "$ADDRLN"); my $res; ## ACE Initialization debug("ACE Initialization"); if (($res = $ace_init->Call()) != 0) { die("Unable to initialize ACE: Result -> $res\n"); } ## ACE Address Handle Initialization debug("ACE Address Handle Initialization"); if (($res = $ace_init_addr->Call(\$ah)) != 0) { $ace_term->Call(); die("Unable to initialize Address Handle: Result -> $res\n"); } ## Set addrln.dct File debug("Set addrln.dct File"); if (($res = $ace_set_file->Call($ah, 5, $addrln_path)) != 0) { $ace_term_addr->Call($ah); $ace_term->Call(); die("Unable to set $ADDRLN: Result -> $res\n"); } print $ace_term_addr->Call($ah) . "\n"; print $ace_term->Call() . "\n"; exit(0); ## ## Subroutines and Functions ## ## Debug sub debug { if ($debug) { my ($msg) = @_; print "$msg\n"; } }

Am I using this right (I keep getting an error on $ace_set_file), if not what is wrong?

Thanks for any help

In reply to Win32::API help by Eshock

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.