Passing data to a callback routine

Discussion in 'C Programming' started by franco.amato, Sep 9, 2008.

  1. franco.amato

    franco.amato

    Joined:
    Sep 9, 2008
    Messages:
    1
    Likes Received:
    0
    Hi to all,
    I'm new here. I wrote a c++ callback and I would pass to it a buffer allocated in another place (in the main or in another class).
    In the callback I'll process the buffer passed. The problem is that the buffer is passed in the stack and sometime I loose the reference on it. I would create and pass it on the heap.
    How can I do it?
    Can I have some line of code as example?
    Regards,
    Franco
     
    franco.amato, Sep 9, 2008
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Diez B. Roggisch

    passing callback function to c-extension

    Diez B. Roggisch, Jan 14, 2004, in forum: Python
    Replies:
    4
    Views:
    434
    Diez B. Roggisch
    Jan 14, 2004
  2. Jeff
    Replies:
    0
    Views:
    922
  3. hemoji@gmail.com

    Passing C++ thread data to Vb thru callback

    hemoji@gmail.com, Jul 8, 2005, in forum: C++
    Replies:
    1
    Views:
    467
    Jack Klein
    Jul 8, 2005
  4. zzorozz@gmail.com

    Passing an object's method as a callback

    zzorozz@gmail.com, Aug 10, 2006, in forum: C++
    Replies:
    2
    Views:
    469
    Thomas J. Gritzan
    Aug 10, 2006
  5. foice
    Replies:
    4
    Views:
    1,301
    James Kanze
    Oct 14, 2010
  6. Simon Harris

    User Data Import Routine

    Simon Harris, Jan 3, 2006, in forum: ASP General
    Replies:
    6
    Views:
    234
    Bob Barrows [MVP]
    Jan 6, 2006
  7. lalawawa
    Replies:
    9
    Views:
    238
    Marnen Laibow-Koser
    Jan 18, 2010
  8. Bill H

    Passing an array to a sub routine

    Bill H, Jan 17, 2006, in forum: Perl Misc
    Replies:
    3
    Views:
    169
    Anno Siegel
    Jan 17, 2006
Loading...