IStream* pstream = NULL; if(SUCCEEDED(CreateStreamOnHGlobal(NULL, TRUE, &pstream))) { ULONG lreal = 0; pstream->Write(chIncomingDataBuffer, iEnd, &lreal ); if(pstream!= NULL) { MessageBox(hWnd, " Stream is OK", "Connection strt", MB_ICONINFORMATION|MB_OK); } Image* image =Image::FromStream(pstream); if(image) { RECT rect; ::GetWindowRect(hWnd, &rect); Graphics graphics(hWnd); graphics.DrawImage(image, 0, 0, rect.right-rect.left, rect.bottom-rect.top); } else { MessageBox(hWnd, "No image is written", "Connection strt", MB_ICONINFORMATION|MB_OK); } if(image) delete image; image = NULL; if(pstream) pstream->Release(); pstream = NULL; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)