Thread: fatal error
View Single Post
Light Poster
4Aug2008,15:02  
E_E_F's Avatar
I think I made a small mistake in my explanation above, the correct order should be like:


// pseudo code:

buffer * a, b; //declare buffer pointers
byte a[100000]; //reserve memory for the buffer
byte b[100000]; //reserve memory for the buffer

bool bufselector= false; //use this switch to choose the right buffer

OnButton1Click{
start_capture(a);
}

OnRequestNewBuffer{
if ( bufselector) capture_nextbuffer(a) //switch buffers, pass the buffer pointer
else capture_nextbuffer(b)
}

OnBufferFull( buffer * fullbuffer){ //the capture function will send a windowmessage.
write_buffer_to_disk(fullbuffer) // the fullbuffer is available to application
}

//end pseudo code.

I have not used real functions or events here, it is just an example. Implementations may be different. It is just to get you started and see the bug picture. You will have to do a lot of initialization I guess.