Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Every time I call a C-function that uses arguments, I get an exception that causes Perl to quit.
What exception (what's the message you receive)? You need to investigate (maybe fire up Event Viewer, or a debugger).

You might need to make sure that your DLL is compiled with the -MD flag (or whatever perl -V:ccflags reports).

update: also, try enabling Win32::API::DEBUG and edit API.h and #define WIN32_API_DEBUG.

I did some testing, and I get a memory access violation in the perl dll, and I've tracked it down to API.xs line 651         XSRETURN_IV(lReturn);. It happens with Win32-API-0.41 and perl 5.8.4, 5.6.2, 5.8.7, but not 5.8.6, go figure. XSRETURN_IV comes from XSUB.h (official api). You should solicit help from the author and the perl5-porters. Here's the verbatim debug output

(XS)Win32::API::Call: params[0].t=1, .u=137 (XS)Win32::API::Call: parameter 0 (N) is 137 (XS)Win32::API::Call: Calling ApiFunctionInteger() (XS)Win32::API::Call: ApiFunctionInteger returned 138 (XS)Win32::API::Call: freeing memory... (XS)Win32::API::Call: returning to caller. (XS)Win32::API::Call: returning 138.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.


In reply to Re: Help avoiding exception in Win32::API ? by PodMaster
in thread Help avoiding exception in Win32::API ? by jimbojones

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (12)
    As of 2014-07-28 12:32 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (196 votes), past polls