What is wrong with this code?
-
#include void callDllFunc(char *, char *, ...); void main() { char *szDllName = "USER32.DLL"; char *szFuncName = "SetWindowTextA"; char szDataType[40]; int numArgs, counter; void *receptor[20]; printf("Enter the number of arguments SetWindowTextA takes: "); scanf("%d", &numArgs); for(counter = 0; counter < numArgs; counter++) { printf("Enter the datatype of arguement %d: ", counter+1); scanf("%s", szDataType); switch(*szDataType) { case 'i': printf("Enter an int value: "); scanf("%d", receptor[counter]); break; default: break; } } } I want to take a variable number of arguments of any time. The user in this case wants to call a function within a Dll and he knows the number and types of the arguments. My problem is how do I take those arguments from the use and pass them on to the Dll? (callDllFunc will take the name of the Dll, the name of the function, and the arguments to be passed to the Dll function)