Variable number of arguments when calling a DLL function

V

Vince

Hi,

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

Vince
 
V

Victor Bazarov

Vince said:
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
 
V

Vince

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

Victor Bazarov

Vince said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top