#include <QtCore/QCoreApplication>#include <afxres.h>int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); bool b = false; LPCTSTR str = (LPCTSTR)"Event"; HANDLE WriteEvent = CreateEvent(NULL, FALSE, FALSE, str); DWORD ddd; while (1) { ddd = WaitForSingleObject(WriteEvent, 1000); if (ddd != 0x00000102L) b = true; } return 0;}
#include <QtCore/QCoreApplication>#include <afxres.h>int main(int argc, char *argv[]){ QCoreApplication a(argc, argv); bool create = false; LPCTSTR str = (LPCTSTR)"Event"; while (!create) { HANDLE Event = OpenEvent(EVENT_ALL_ACCESS, FALSE, str); int i = GetLastError(); if (Event != 0x00000000) { SetEvent(Event); create = true; } } return 0;}
C++ (Qt)while (!b){ ... if (ddd == WAIT_OBJECT_0) b = true; else { /* обработка ошибок */ }}
LPCTSTR str = (LPCTSTR)"Event"; HANDLE hWriteEvent = CreateEvent(NULL, FALSE, FALSE, str); int i = GetLastError(); DWORD ddd = 0x00000102L; while (ddd == 0x00000102L) { ddd = WaitForSingleObject(hWriteEvent, 1000); } HANDLE hMappedFlying = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 1048576, ((const WCHAR*)"map_flying"));
LPCTSTR str2;str2 = (LPCTSTR) "map_flying";
CString s;LPCTSTR lp;s="throw";lp = (LPCTSTR) s;
LPCTSTR str = L"Event";