Thread: How do wait till a callback function returns

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    1

    Question How do wait till a callback function returns

    Hi,
    I am writing a library. Any exe will build with this library. The library exposes a API which the exe calls. The API inturn registers a callback function. Now how do i wait for the control to return to this callback function. So the sequence of operations is as follows

    1) Api Call
    2) Call another lib API and register Callback function
    3) Process the result in call back function
    4) Resume operation from the point where we call the next lib api and register the callback ie from point 2
    5)further process the data in the first API
    6) return the result of the API call to the exe

    TIA

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Are you wrapping an asynchronous API with a synchronous API? In other words, does the underlying API invoke the callback within the context of another thread? Or does the callback get invoked within the same thread that performed step #2?

    Windows or *nix or both?

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 08-24-2008, 11:39 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM

Tags for this Thread