Variable number of arguments when calling a DLL function

Discussion in 'C++' started by Vince, Nov 10, 2004.

  1. Vince

    Vince Guest

    Hi,

    I'd like to know how to call a DLL function, when the number of argument can
    be variant.
    Thanks,

    Vince
     
    Vince, Nov 10, 2004
    #1
    1. Advertising

  2. Vince wrote:
    > I'd like to know how to call a DLL function, when the number of argument can
    > be variant.


    You call that function like any other function, by passing the arguments.
    Whether that function is in a DLL doesn't matter.

    V
     
    Victor Bazarov, Nov 10, 2004
    #2
    1. Advertising

  3. Vince

    Vince Guest

    Sorry, my explanation was not clear.
    In fact, I've got a module in an application that calls DLL functions, but
    the module must call any function, without knowing the number of argments.



    "Victor Bazarov" <> a écrit dans le message de news:
    j_rkd.8465$09.us.to.verio.net...
    > Vince wrote:
    >> I'd like to know how to call a DLL function, when the number of argument
    >> can be variant.

    >
    > You call that function like any other function, by passing the arguments.
    > Whether that function is in a DLL doesn't matter.
    >
    > V
     
    Vince, Nov 10, 2004
    #3
  4. Vince wrote:
    > Sorry, my explanation was not clear.
    > In fact, I've got a module in an application that calls DLL functions, but
    > the module must call any function, without knowing the number of argments.


    If it doesn't know the number (ang types, I presume) of arguments, what
    do you expect from that call? If I don't provide the very first argument
    to, say, 'printf', it's still going to look for it, and use whatever is
    in the stack as if I actually provided it.

    So, your question is probably, "how do I write code that will call _any_
    function with all its arguments by building the argument list dynamically
    using some other source of information". IOW, you're looking for guides
    for implementing interpreters. This is a wrong newsgroup, then. It is
    not possible to achieve what you're looking for without compiler-specific
    or platform-specific stuff. Post to the newsgroup for your OS or your
    compiler.

    Oh, and if you can help it, don't top-post, please. Thanks.

    > "Victor Bazarov" <> a écrit dans le message de news:
    > j_rkd.8465$09.us.to.verio.net...
    >
    >>Vince wrote:
    >>
    >>>I'd like to know how to call a DLL function, when the number of argument
    >>>can be variant.

    >>
    >>You call that function like any other function, by passing the arguments.
    >>Whether that function is in a DLL doesn't matter.
    >>
    >>V

    >
    >
    >



    --
    Please remove capital As from my address when replying by mail
     
    Victor Bazarov, Nov 10, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex
    Replies:
    1
    Views:
    373
    Ron Natalie
    Oct 16, 2003
  2. EricLin
    Replies:
    2
    Views:
    347
    E. Robert Tisdale
    Feb 6, 2004
  3. jmborr
    Replies:
    1
    Views:
    423
    Stargaming
    Nov 3, 2007
  4. Replies:
    3
    Views:
    828
  5. Navaneeth
    Replies:
    4
    Views:
    553
    Kenny McCormack
    Nov 20, 2010
Loading...

Share This Page