Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Variable number of arguments when calling a DLL function

Reply
Thread Tools

Variable number of arguments when calling a DLL function

 
 
Vince
Guest
Posts: n/a
 
      11-10-2004
Hi,

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

Vince


 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      11-10-2004
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
 
Reply With Quote
 
 
 
 
Vince
Guest
Posts: n/a
 
      11-10-2004
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$. 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



 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      11-10-2004
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$. 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a function that expects variable arguments from a functionwith variable arguments Navaneeth C Programming 4 11-20-2010 05:35 AM
Call again a variadic function (... variable number of arguments)with same arguments that its variadic wrapper moreau.steve@gmail.com C Programming 3 12-31-2008 07:13 AM
how to pass a function name and its arguments inside the arguments of other function? jmborr Python 1 11-03-2007 08:20 AM
variable number of arguments + function pointers Alex C++ 1 10-16-2003 10:31 PM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments