사실, 하나의 응용 프로그램에서 다른 슬롯으로 win32의 파이프가있는 4 개의 슬롯 배열 인 * var을 보내려고합니다. 이 작업을 올바르게 수행하려면 어떻게해야합니까?파이프를 통해 구조체 배열 보내기 : win32, C
는 지금까지 내가 아는 한, 내가 제대로하고 있어요 :
//sending like this:
if (!WriteFile(hPipeWriteGhosts[i],Ghosts, (DWORD) sizeof(map)*4, &n, NULL))
{
printf("[ERROR] Writing in the pipe... (WriteFile)\n");
exit(1);
}
//receiving like this
ret = ReadFile(HReadSPipe, Ghosts, sizeof(map)*4, &n, NULL); // Lê até ao numero de bytes for zero (pipe fechado) pk o cliente escreveu fim e n escreveu mais nada
if (!ret || !n)
MessageBox(hDlgGlobal, str, "Error", MB_YESNO | MB_ICONINFORMATION); // But in fact it shows me this all the time.
어떻게 올바르게 할 수 있습니까?
미리 감사드립니다.
'유령'은 무엇입니까? – zmbq
아 미안 유령은 *지도 구조체지도 { \t INT X, XB이다; \t int y, yb; \t HBITMAP bitm; \t int TypeOfMessage; \t char * BelongToUser; // 객체 소유자를 식별합니다 (이 객체가 GG 인 경우) \t char 유형 [1]; // 무의미한 0, 비트 맵 업데이트 1 개, 다른 것들 }; 그것을거야 가게를 sizeof (지도) * 4 –
이 .. 유령이 사실이이 잘못된 것을 생각하게는 sizeof (지도) * 4 –