in reply to Re: Call a function from DLL
in thread Call a function from DLL

Dear Discipulus,

Thank you very much for offering to help,

Actually the I have another question:

the idea is , I want to call the function FCWIntiObject() and the return value must be as object.

then I want to call the second function int FCWOpenCleware(object*) which it takes the return value from the previous function as an argument.

could you help me?

thanks in advance.

Replies are listed 'Best First'.
Re^3: Call a function from DLL
by GrandFather (Saint) on Jul 15, 2019 at 08:18 UTC

    Dealing with C++ (as opposed to C) function calls is something of a problem because the C++ compiler mangles function names to allow for function overloading and such C++ magic. Name mangling tends to be rather specific to individual C++ compilers as are calling conventions. You need some very specific information about the compiler you are using to even call the functions. Passing objects back and forth may either be easy (if you treat them as completely opaque objects) or potentially very complicated if you need to get involved in memory management and accessing parts of the object.

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

      I would thank you for your reply, but acutely I have no idea to do that in Perl

      Do you have any suggestion?

      thanks in advance

        I don't have any helpful suggestions because getting the job done depends on very specific details of the compilers used for the code you are calling and possibly for the compiler use for compiling the Perl you are using. The details of the source for the code you are calling may also be important. There are too many variables for me to help without a lot more information, and possibly not even then.

        Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re^3: Call a function from DLL
by holli (Abbot) on Jul 15, 2019 at 08:45 UTC
    Your best bet is probably to nest calls, as in
    $FCWOpenCleware->Call( $FCWIntiObject->Call() )


    holli

    You can lead your users to water, but alas, you cannot drown them.