Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. What is wrong with this code?

What is wrong with this code?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mvworld
    wrote on last edited by
    #1

    #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)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups