1

In unmanaged C++ code on a 32-bit or 64-bit platform, suppose I want to provide an API function called CallDLLFunction which will invoke a DLL function on behalf of its caller. This API function will have these parameters to work with:

CallDLLFuction ( FullyQuialifiedDLLName, DLLFunction, ReturnType, ListOfParameterTypes, ListOfParameters )

The only things the API function knows about with regard to the target DLL function are via these parameters passed to it. Could someone please illustrate how you would implement this function? I am assuming that (on Windows) LoadLibrary and GetProcAddress must be used to call the "DLLFunction" within the "FullyQuialifiedDLLName" DLL. So at the heart of the problem seems to be how to use GetProcAddress in a generic way when the parameter types and return types vary, and cannot be systematically listed or known ahead of time.

Darrin
  • 317
  • 1
  • 4
  • 10

0 Answers0