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

That's not a hardcoded address, just a string containing numbers.

No way. "L" does not create a string.

I've never used VB, but looking at the linked article I guess that the VB String type is compatible with c/C++ char*.

Then he would just have to use "P".

  • Comment on Re^7: Perl program calling external .dll functions

Replies are listed 'Best First'.
Re^8: Perl program calling external .dll functions
by BrowserUk (Patriarch) on Mar 18, 2011 at 21:08 UTC
    No way. "L" does not create a string.

    Obviously, but if he knew how to do it, he wouldn't have to ask the question.

    Given the "String" in the supplied prototype, I rather more inclined to think he intended to pass '123456789' as a string, but used the wrong parameter code (L rather than P), rather than believe that he intended that a string of ascii decimals would be converted to a number and encoded as a pointer. To...something?

    Aren't you?


    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.

      Of course I still think "L" is wrong. ("Whatever it is, it's definitely not a uint32_t as you're telling Win32::API it is.") You're the only one who suggested otherwise. ("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'm inclined to think it's neither of the options you presented, though. C++ does have a class named String. Waiting on the OP for clarification. (Upd: Oops, it's actually "string" (in the "std" namespace). )

      If he does mean C++'s String, I doubt the layout of the class is defined. A portable solution would be impossible without processing the appropriate .h file. That's why I recommended Inline::CPP.