Connecting Tech Pros Worldwide Forums | Help | Site Map

Variable number of arguments when calling a DLL function

Vince
Guest
 
Posts: n/a
#1: Jul 22 '05
Hi,

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

Vince



Victor Bazarov
Guest
 
Posts: n/a
#2: Jul 22 '05

re: Variable number of arguments when calling a DLL function


Vince wrote:[color=blue]
> I'd like to know how to call a DLL function, when the number of argument can
> be variant.[/color]

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

V
Vince
Guest
 
Posts: n/a
#3: Jul 22 '05

re: Variable number of arguments when calling a DLL function


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" <v.Abazarov@comAcast.net> a écrit dans le message de news:
j_rkd.8465$Ae.4561@newsread1.dllstx09.us.to.verio. net...[color=blue]
> Vince wrote:[color=green]
>> I'd like to know how to call a DLL function, when the number of argument
>> can be variant.[/color]
>
> You call that function like any other function, by passing the arguments.
> Whether that function is in a DLL doesn't matter.
>
> V[/color]


Victor Bazarov
Guest
 
Posts: n/a
#4: Jul 22 '05

re: Variable number of arguments when calling a DLL function


Vince wrote:[color=blue]
> 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.[/color]

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.
[color=blue]
> "Victor Bazarov" <v.Abazarov@comAcast.net> a écrit dans le message de news:
> j_rkd.8465$Ae.4561@newsread1.dllstx09.us.to.verio. net...
>[color=green]
>>Vince wrote:
>>[color=darkred]
>>>I'd like to know how to call a DLL function, when the number of argument
>>>can be variant.[/color]
>>
>>You call that function like any other function, by passing the arguments.
>>Whether that function is in a DLL doesn't matter.
>>
>>V[/color]
>
>
>[/color]


--
Please remove capital As from my address when replying by mail
Closed Thread