Calling DLL functions without known function name, parameter-list until run-time 
Author Message
 Calling DLL functions without known function name, parameter-list until run-time

If anyone knowns of a way in which I can call an external DLL function
which was loaded at run-time, using LoadLibrary, using a User-specified
parameter list, please let me know.

I am writing code which requires fetching an external DLL module name,
procedure name, parameter type list, and parameter list from the user at
run-time.  I then need to call the user-specified DLL procedure.

I am calling 32-bit Window's DLL's using the Pascal calling convention
and am wondering (hoping) there is a portable way in C/C++.   If there are
any
C run-time library or Win32 API functons to "push" parameters
on the stack left-to-right, and then call the user-specific DLL function,
please
let me know.

If I need to write this is an assmebly, I will.  But I would prefer a way
that would
be portable across multiple architure, rather that write an Intel, MIPS,
Alpha, etc
version.

Please let me know if anyone has any solutions,

Thanks,
Mike Mascari



Mon, 14 Aug 2000 03:00:00 GMT  
 Calling DLL functions without known function name, parameter-list until run-time


Quote:

>I am writing code which requires fetching an external DLL module name,
>procedure name, parameter type list, and parameter list from the user at
>run-time.  I then need to call the user-specified DLL procedure.

  From the user?  How should they know?

  I would include one function, which your code knows about, in any such DLL,
whose job is to report back the names and parameter types of functions exported
by the DLL.  

  This is the guts of what "COM Automation" is all about.  No need to reinvent
all of this from scratch....

David G



Mon, 14 Aug 2000 03:00:00 GMT  
 Calling DLL functions without known function name, parameter-list until run-time



Quote:

>If anyone knowns of a way in which I can call an external DLL function
>which was loaded at run-time, using LoadLibrary, using a User-specified
>parameter list, please let me know.

My guess would be the Windows experts (DLLs are a feature of the Windows
environment, not the C language). Try sking them over on
comp.os.ms-windows.programmer.misc.

...

Quote:
>If I need to write this is an assmebly, I will.  But I would prefer a way
>that would
>be portable across multiple architure, rather that write an Intel, MIPS,
>Alpha, etc
>version.

How you access dynamic link libraries is platform-specific, you won't find
a portable solution, although there is a fairly standardised interface
across Unix versions (see comp.unix.programmer).

--
-----------------------------------------


-----------------------------------------



Tue, 15 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. DLL function calling problems (explicit - only knowing function name at runtime)

2. Call a function in a function with name of a function as parameter

3. Call a function with an argument list built up at run time

4. Copy Registry Entry Without Deleting Old Entry ~ function call parameters not correct

5. Copy Registry Entry Without Deleting Old Entry ~ function call parameters not correct

6. how to know th exact function name of mfc42.dll

7. Question : A generic function to retrieve the call parameters of a function

8. not calling function at run time ..

9. run time function call

10. Question : A generic function to retrieve the call parameters of a function

11. C function call at run time

12. Function Parameters Change when function called?!

 

 
Powered by phpBB® Forum Software