Thread: Convert callback to varible?

  1. #1
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342

    Question Convert callback to varible?

    Is this evev possible to do? If so, how?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Is this your entry in the terse question of the week award competition?

    If you're referring to function pointers, then yes is the answer.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    Quote Originally Posted by Salem
    Is this your entry in the terse question of the week award competition?

    If you're referring to function pointers, then yes is the answer.
    No I'm not, I mean converting (more so moving the actuall data in memory that the callback is obtaining into a varible for handling.

    In specific, a FARPROC to an PLVOID.

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by Queatrix View Post
    No I'm not, I mean converting (more so moving the actuall data in memory that the callback is obtaining into a varible for handling.

    In specific, a FARPROC to an PLVOID.
    I really do not understand the question...
    Any data stored in the memory and pointed by some pointer could be stored in a variable of some kind and then processed in some way... What it has to do with the callback?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well if it's a well-written callback, it will get some kind of 'context' pointer which relates to the data which it is supposed to work with.

    Given any pointer to any bit of user data, you can use that to get access to whatever data you need.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. Replies: 3
    Last Post: 07-19-2008, 03:12 PM
  3. callback in a class, what do I do?
    By Yarin in forum C++ Programming
    Replies: 5
    Last Post: 08-17-2007, 11:11 AM
  4. typesafe callback system
    By gandalf_bar in forum C++ Programming
    Replies: 1
    Last Post: 05-22-2004, 06:35 AM
  5. Convert Char to Int Function
    By drdroid in forum C++ Programming
    Replies: 9
    Last Post: 02-19-2003, 12:53 PM