Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: How to pass a pointer to an array of 'unsigned char' C data type with Win32::API (error)

by tye (Sage)
on Jul 28, 2016 at 14:07 UTC ( #1168732=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to pass a pointer to an array of 'unsigned char' C data type with Win32::API ("U0")
in thread How to pass a pointer to an array of 'unsigned char' C data type with Win32::API

I don't see any reason for Perl to crash. But you don't even provide the error message associated with the Perl crash so we don't have much to go on to diagnose the problem.

- tye        

  • Comment on Re^3: How to pass a pointer to an array of 'unsigned char' C data type with Win32::API (error)

Replies are listed 'Best First'.
Re^4: How to pass a pointer to an array of 'unsigned char' C data type with Win32::API (error)
by apeks_okad (Novice) on Jul 28, 2016 at 15:52 UTC

    The error message is a windows error "Perl interpreter does not function anymore" (translated from the original German Error "Perl interpreter funktioniert nicht mehr"

        Wow..! That's quite a bit of research :). Those are exactly my reference documents.

        Yes, I am setting the value of the KSENT_TXInit as per the document (and getting an "all OK" return from the call) before calling the KSENT_TX function

        I wasn't so sure of the description in the document regarding the length of the information to be sent and hence contacted the developer of the DLL who replied saying that "the *data is a pointer to an array of unsigned chars were each char is a SENT nibble"

        So i tried quite a few possibilities in addition to the one mentioned in the original query

        passing only the 3 nibbles as 3 unsigned chars  my $data_ref = pack ('U0C*', 0x01,0x05,0x05);

        and passing the 3 nibbles in 2 octets

         my $data_ref = pack ('U0C*', 0x01,0x55);

        and passing all the 8 nibbles as 8 unsigned chars

        my $data_ref = pack ('U0C*', 0x08,0x01,0x05,0x05,0x00,0x00,0x0E,0x00);

        All of it still crashes with the same error. On hindsight, I think the correct windows error would be "Perl interpreter encountered an issue". I will try dumping the details of the failure if it helps further.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1168732]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2020-10-24 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (242 votes). Check out past polls.

    Notices?