Can U Use a string to call a function

This is a discussion on Can U Use a string to call a function within the C Programming forums, part of the General Programming Boards category; Hi, Can someone please tell me if it is possible to use a string to call a function? If so ...

  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    9

    Can U Use a string to call a function

    Hi,

    Can someone please tell me if it is possible to use a string to call a function?

    If so can you give an example.

    thanks,
    Passy

  2. #2
    Registered User
    Join Date
    Aug 2003
    Posts
    32
    A quick search produced this page, which I think is what you were after:

    Changing a input string to a function call?

    Cheers,
    Z.
    Beware the fury of a patient man.

  3. #3
    Registered User
    Join Date
    Aug 2003
    Posts
    9
    thx

  4. #4
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Just to throw the cat among the pigeons.

    Given type information and a function pointer, this is entirely possible.

    See the windows function DispInvoke.

    DispInvoke builds a stack frame, coerces parameters using standard coercion rules, pushes them on the stack, and then calls the correct member function in the VTBL.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Inheritance Hierarchy for a Package class
    By twickre in forum C++ Programming
    Replies: 7
    Last Post: 12-08-2007, 03:13 PM
  3. Help calling function is asm
    By brietje698 in forum C++ Programming
    Replies: 24
    Last Post: 12-06-2007, 03:48 PM
  4. String issues
    By The_professor in forum C++ Programming
    Replies: 7
    Last Post: 06-12-2007, 09:11 AM
  5. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21