tomcatlikegame 2004年07月10日
eVC Windows CE 同步问题
下面的程序我把它该成vc程序可以在windows 2000上运行,但是在Smartphone 2003和Emulator 上运行不了,出现wait_failed错误,那位指教一下.

#include <windows.h>
#include <Winbase.h>
#include <memory.h>
#include <notify.h>
#include <winioctl.h>

int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPWSTR lpCmdLine,
int CmdShow)


{
HANDLE hEvents[2];
DWORD dwWaitResult;
DWORD error=0;

hEvents[1] = CreateEvent(NULL, FALSE, TRUE, L"DDD_READ_EVENT");
hEvents[0] = CreateEvent(NULL, TRUE, TRUE, L"DDD_WRITE_EVENT");

dwWaitResult = WaitForMultipleObjects(2, hEvents, TRUE, 6000);
switch(dwWaitResult)
{
case WAIT_OBJECT_0:
MessageBox(NULL, L"Read successfully", L"Info", MB_OK);
break;
case WAIT_OBJECT_0+1:
MessageBox(NULL, L"Read successfully", L"Info1", MB_OK);
break;
case WAIT_FAILED:
error = GetLastError();
MessageBox(NULL, L"Wait_failed", L"Info", MB_OK);
break;
case WAIT_TIMEOUT:
MessageBox(NULL, L"Wait_Timeout", L"Info", MB_OK);
break;
default:
MessageBox(NULL, L"Other info", L"Info", MB_OK);
break;
}
SetEvent(hEvents[0]);
return 0;
}
...全文
25 点赞 收藏 1
写回复
1 条回复

还没有回复,快来抢沙发~

发动态
发帖子
VC.NET
创建于2007-09-28

7260

社区成员

2.7w+

社区内容

.NET技术 VC.NET
社区公告
暂无公告