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

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.

Replies are listed 'Best First'.
Re^6: Perl program calling external .dll functions
by BrowserUk (Patriarch) on Mar 18, 2011 at 08:29 UTC
    I didn't use hardcoded address 123456789

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

    or ' '. (Is that a weird way of saying NULL?)

    Again, just a string containing four spaces.

    He really is being unclear if he can't even communicate which language's class he's talking about.

    Agreed. Reading between the lines, I'd guess that he's not a C++ programmer, and all he has is a VB example he's attempting to interpret.

    , it doesn't say anything about the structure of the type, necessary knowledge for building an instance of one.

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

    I can't test anything because my 32-bit perl Win32::API setup is broken. Maybe this info will help you help him.


    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.

      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".

        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.