In addition to what has been said in other solutions, you need to use some synchronisation mechanism (lock, semaphore, mutex) or concurrent containers or some lock-free container.
In particular, the line
while((cqueue::front==-1));
is really bad because it cause busy waiting which is bad for general performance or battery duration.
Given that it seems that you know nothing about threading, it would be a good idea for you to read some tutorial on this... otherwise your program won't works correctly.
MSDN documentation have a lot of information about that. The following page give you an overview of available functions at the Win32 API level:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms686360(v=vs.85).aspx[
^]
You can use a semaphore for you problem (circular buffer) or some lock and a bit more logic.
In any case, you want to use a wait function (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx[
^]) as an example so that the CPU will be free for use by other programs until some data is ready.
Also in your
cqueue
class, none of the member should be static as otherwise you cannot use that class more than once. And there are many other problem with your code. It might be a good idea to read some books to help you make more robust programs.