Single pipe transmission between MFC processes
no vote
Application background Single pipe data transmission between processesOperating platform: pro win10+vs2013Operating results:1, the conversion between characters and wide characters/ / wide character to characterTcharToChar void (TCHAR TCHAR * char, const * _char){ILength int;Get / / byte lengthILength = WideCharToMultiByte (CP_ACP, 0, TCHAR, -1, NULL, 0, NULL, NULL);The TCHAR / _char to the valueWideCharToMultiByte (CP_ACP, 0, TCHAR, -1, _char, iLength, NULL, NULL);}/ / characters to wide charactersCharToTchar void (char _char * TCHAR, const * TCHAR){ILength int;ILength = MultiByteToWideChar (CP_ACP, 0, _char, strlen (_char) + 1, NULL, 0);MultiByteToWideChar (CP_ACP, 0, _char, strlen (_char) + 1, TCHAR, iLength);}2, creating process and single pipe transmissionCDemoDlg: void: OnBnClickedButton1 (){TODO: / / add control notification handler code here/ / pipeHPWrite hPRead, HANDLE;SA SECURITY_ATTRIBUTES = {0};Sa.nLength = sizeof (SA);Sa.bInheritHandle = TRUE;Sa.lpSecu