473,804 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Variable number of arguments when calling a DLL function

Hi,

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

Vince
Jul 22 '05 #1
3 2165
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
Jul 22 '05 #2
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.********@com Acast.net> a écrit dans le message de news:
j_************* ***@newsread1.d llstx09.us.to.v erio.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

Jul 22 '05 #3
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" <v.********@com Acast.net> a écrit dans le message de news:
j_************* ***@newsread1.d llstx09.us.to.v erio.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
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
6300
by: Kapt. Boogschutter | last post by:
I'm trying to create a function that has at least 1 Argument but can also contain any number of Arguments (except 0 because my function would have no meaning for 0 argument). The arguments passed to the function are strings or must be (automaticly converted to a string e.g. the number 10 should become the string "10". My problem is that I can only find samples and description of printf() like functions where the optional arguments and...
3
2018
by: Grant Wagner | last post by:
Given the following working code: function attributes() { var attr1 = arguments || '_'; var attr2 = arguments || '_'; return ( function (el1, el2) { var value1 = el1 + el1; var value2 = el2 + el2; if (value1 > value2) return 1;
10
1887
by: Felix Kater | last post by:
Hi, is it possible to define a function in a way that when calling it I can insert as many arguments as I want? (I would neither like to define a function with 50 default arguments nor prepare a pointer array each time before calling the function and pass the array, though.) I imagine function calls like this: f(a,b,c);
3
2804
by: Nimmi Srivastav | last post by:
Consider two functions A and B, both of which accept a variable number of arguments (va_start, va-arg, va_end). Is there an easy way for arguments passed to A to be, in turn, passed to B? (For example, if A is a wrapper function around B). Thanks, Nimmi
7
2197
by: Aaron | last post by:
Complete code follows. I am new to .NET programming (and programming in general) and I am having a difficult time understanding how to fill a variable in one sub, and then access it from another. I have tried declaring them as shared, public, friend, etc and I always get an error stating that something is not valid on a local variable declaration. For example, in the following code for Sub DataGrid_Select, I have CurrentID and...
23
19206
by: Russ Chinoy | last post by:
Hi, This may be a totally newbie question, but I'm stumped. If I have a function such as: function DoSomething(strVarName) { ..... }
18
4364
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I can use dlopen/whatever to convert the function name into a pointer to that function, but actually calling it, with the right number of parameters, isn't easy. As far as I can see, there are only two solutions: 1) This one is portable. If...
18
4068
by: Pedro Pinto | last post by:
Hi there once more........ Instead of showing all the code my problem is simple. I've tried to create this function: char temp(char *string){ alterString(string); return string;
6
3222
by: CptDondo | last post by:
How do you declare a function with 0 or mroe arguments? I have a bunch of functions like this: void tc_cm(int row, int col); void tc_do(void); void tc_DO(int ln); and I am trying to declare a pointer to them:
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9575
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.