Thanks for the advice.

I tried using Inline::C, but it's still not quite working. The wrappers around a few of the library routines (initialization, for example) do appear to be working correctly, however, it crashes whenever running the C callback function. In the C callback function, what it should be doing is copying the necessary data to perl variables, doing a "perl_call_sv" to call the user specified perl callback function, then copying the data back from perl variables. What's happening though is that the program crashes whenever I try to do anything in the C language callback function.

No matter what code I put in the C callback, I get ``unhandled exception...: access violation reading location...''

I can confirm that the callback function is actually being called because I've made a counter variable that increments each time its run. Upon close, I have the program print the contents, and it looks like its being run the right number of times. However, anything more complicated than that and it crashes.

Any thoughts?


In reply to Re^4: perl->c->perl (Inline::C) by jpollack
in thread perl->c->perl by jpollack

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.