in reply to Re: Perl program calling external .dll functions
in thread Perl program calling external .dll functions

simply the the .dll function is written in C++ and 2 string type arguments are passed through it. and it has a long return type. actually this .dll behaves fine with calling from VB6.0 but trying with perl, interpreter crashes in its call or return 0 on passing argument type mentioned as 'P'(Pointer to string).
  • Comment on Re^2: Perl program calling external .dll functions

Replies are listed 'Best First'.
Re^3: Perl program calling external .dll functions
by ikegami (Patriarch) on Mar 18, 2011 at 06:51 UTC

    Assuming the STL even defines the internal storage format of a String, I don't know what it is. Whatever it is, it's definitely not a uint32_t as you're telling Win32::API it is.

    "P" passes a pointer to the a copy of the scalar's string buffer. Don't know if your String is compatible with what you are passing were you to use "P". But you're not using "P". You're using "L".

    You've provided no useful data about the type. You didn't provide the calling convention used.

    I think you'd be much better off using Inline::CPP.

      Given the mention of Visual Basic, I'd assume that the String type mentioned is a the VB type String. Passed by reference this would render an address, which on a 32-bit platform will usually come through successfully as a 32-bit numeric. Not a great idea, but it would mostly work.

      See kb106553 for some info.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Passed by reference this would render an address, which on a 32-bit platform will usually come through successfully as a 32-bit numeric.

        I thik I've used "L" to pass pointers — specifically, for nullable pointers — but I didn't use hardcoded address 123456789 or '    '. (Is that a weird way of saying NULL?)

        I'd assume that the String type mentioned is a the VB type String.

        He said the function is written in C++, I figured it was C++'s String. He really is being unclear if he can't even communicate which language's class he's talking about.

        But even if he were to communicate which class he's using clearly, it doesn't say anything about the structure of the type, necessary knowledge for building an instance of one.