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
    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. Advertising

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. hemoji@gmail.com

    Passing C++ thread data to Vb thru callback

    hemoji@gmail.com, Jul 8, 2005, in forum: C++
    Replies:
    1
    Views:
    386
    Jack Klein
    Jul 8, 2005
  2. foice
    Replies:
    4
    Views:
    1,054
    James Kanze
    Oct 14, 2010
  3. Simon Harris

    User Data Import Routine

    Simon Harris, Jan 3, 2006, in forum: ASP General
    Replies:
    6
    Views:
    91
    Bob Barrows [MVP]
    Jan 6, 2006
  4. lalawawa
    Replies:
    9
    Views:
    129
    Marnen Laibow-Koser
    Jan 18, 2010
  5. Bill H

    Passing an array to a sub routine

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

Share This Page