I'm currently writing a wrapper library for windows mobile in C/C++. I have to implement and export the following functions:
void start_scanning();
int wait_for_scanning_result();
void stop_scanning();
start_scanning()
is called to start the scanning process. wait_for_scanning_result()
will wait until a result is available and return it, and stop_scanning
will abort the process.
The library I am using has a callback function that is executed when a result is available.
void on_scanning_result(int result)
{
/* My code goes here */
}
Unfortunately I have to implement the functions above, so my plan was to solve it like this:
void on_scanning_result(int result)
{
scan_result_available = 1;
scan_result = result;
}
int wait_for_scanning_result()
{
/* ... wait until scan_result_available == 1 */
return scan_result;
}
I have no idea how to do this in windows/C and I would be very glad if someone could help me or tell me which functions I have to use to accomplish this.