Re: Call DLL without knowing arguments
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Wed, 5 Nov 2008 08:27:18 -0700
1. You can't, unless it's a C++ function not marked with extern "C" to hide
the C++ name mangling. If it's a C function, there is no way, other than
knowing ahead of time, what the parameters are supposed to be.
2. __asm can be used *for some processors*. If my recollection is correct,
it works for x86, but not for any of the others.
To use a .s file (for ARM, anyway), just use it as you would a .c file, but
write it in the assembly language of the target processor.
Paul T.
"Filipe Madureira" <FilipeMadureira@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:9F455861-5908-44A2-9537-4D13ED3D1D93@xxxxxxxxxxxxxxxx
Hi,
I have 2 questions that are related:
I need to allow the user of my application to run a function from any DLL
he
wants.
The problem is the "variable and unknown argument list".
Question 1:
How can I call a DLL function filling in the arguments by code?
The only solution I found so far is to use assembly code. Anyone knows of
an
alternative?
Question 2:
In PC I can use the __asm directive to add assembly code.
So I just do "push" for the arguments, and then "call" the function
address
I got with "GetProcAddress".
But eVC says: "nonstandard extension used : '__asm' keyword not supported
in
this product"
I read that I can use the assembly code in a .s file. But I did not find
any
documentation on how to use .s file code in C++ code or how to link it.
How do I use a .s file?
Thanks
.
- Follow-Ups:
- Re: Call DLL without knowing arguments
- From: Filipe Madureira
- Re: Call DLL without knowing arguments
- References:
- Call DLL without knowing arguments
- From: Filipe Madureira
- Call DLL without knowing arguments
- Prev by Date: Call DLL without knowing arguments
- Next by Date: Re: Restarting a CWinThread when it is running halfway.
- Previous by thread: Call DLL without knowing arguments
- Next by thread: Re: Call DLL without knowing arguments
- Index(es):
Relevant Pages
|