Convert callback to varible?

This is a discussion on Convert callback to varible? within the C++ Programming forums, part of the General Programming Boards category; Is this evev possible to do? If so, how?...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 11:53 AM

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