小弟有两个问题:
1.在一个死循环里面用哪个函数可以令程序还可以响应鼠标键盘的输入?
vb里面有DoEvent函数,不知道vc有没有类似的函数呢?
2.vc用哪个函数可以测试包含中文字符的字符串的BYTE真实长度?而不是unicode长度?
谢谢!!!
gz
据我所知没有,换别的方法吧。
1:
fDone = FALSE;
while (!fDone)
{
fDone = DoLengthyOperation(); // application-defined function
// Remove any messages that may be in the queue. If the
// queue contains any mouse or keyboard
// messages, end the operation.
while (PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE))
{
switch(msg.message)
{
case WM_LBUTTONDOWN:
//DoSomething;
case WM_RBUTTONDOWN:
//DoSomething;
case WM_KEYDOWN:
//DoSomething;
......
}
}
}
2:
char *kk = "中华人民共和国";
int t = strlen(kk);
1.OnIdle空闲处理.
2.::lstrlen(String)