opencv,small yet weird problem or bug

Hello world!
This is what i'm trying:
Create a blank window, do nothing to that.
add a loop to main which continuously output "test".
Weird think is that when outputing, the window becomes "no response".
After terminating the loop, it response again.

Please, somebody help me with this and many thanks!

code:
#include <highgui.h>
#include <cv.h>
#include <stdio.h>
#include <time.h>
#include <iostream>
#include <fstream>
#include <conio.h>
#include <windows.h>
#include <commctrl.h>
#include <stdlib.h>

using namespace std;

int main(int argc, char* argv[])
{


cvNamedWindow("dst",CV_WINDOW_AUTOSIZE);
while(true){
cout<<"test"<<endl;
cvWaitKey(1000);
unsigned char cmd = 0;
if(kbhit()) {
cmd = getch();
}
if(cmd==27) break;
}

cvWaitKey(-1);

return 0;
}
Topic archived. No new replies allowed.