Click here to Skip to main content
15,895,740 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Kernel programming Pin
Albert Holguin8-Feb-13 6:01
professionalAlbert Holguin8-Feb-13 6:01 
AnswerRe: Kernel programming Pin
Albert Holguin8-Feb-13 6:06
professionalAlbert Holguin8-Feb-13 6:06 
QuestionDirectShow Video Playback from memory Pin
sdancer756-Feb-13 3:07
sdancer756-Feb-13 3:07 
AnswerRe: DirectShow Video Playback from memory Pin
Code-o-mat8-Feb-13 8:35
Code-o-mat8-Feb-13 8:35 
GeneralRe: DirectShow Video Playback from memory Pin
sdancer758-Feb-13 21:49
sdancer758-Feb-13 21:49 
GeneralRe: DirectShow Video Playback from memory Pin
Code-o-mat9-Feb-13 0:19
Code-o-mat9-Feb-13 0:19 
GeneralRe: DirectShow Video Playback from memory Pin
sdancer759-Feb-13 5:19
sdancer759-Feb-13 5:19 
QuestionBitmap Display from Buffer received by TCP socket Pin
Sachin k Rajput 6-Feb-13 1:21
Sachin k Rajput 6-Feb-13 1:21 
I want to display my image on window without saving it.
When data is received window size changes but there is no display
on window.
My Code is:

C++
int iBufferLength;
    int iEnd;
    int iSpaceRemaining;
     
    int i;
 
    iBufferLength = iSpaceRemaining = sizeof(chIncomingDataBuffer);
    iEnd = 0;
    iSpaceRemaining -= iEnd;
 
    iBytesRead = recv(Socket, chIncomingDataBuffer+iEnd, iSpaceRemaining, 0);
     
    iEnd+=iBytesRead;
    if (iBytesRead == SOCKET_ERROR)
        MessageBox(hWnd,
                        "Socket Error",
                        "Connection strt",
                        MB_ICONINFORMATION|MB_OK);
        chIncomingDataBuffer[iEnd] = '\0';
 
    if (lstrlen(chIncomingDataBuffer) != 0)
    {
        /*FILE* pfile;
                     
                    pfile =     fopen("test.jpeg", "wb");
                fwrite(chIncomingDataBuffer,1, iBytesRead ,pfile);
                fclose(pfile);*/
 
                GetWindowRect(hWnd, &rect);
                SetWindowPos(hWnd, NULL, rect.left, rect.top, cBitmap.bmWidth, cBitmap.bmHeight, 0);
                  HDC ThisDC = GetDC(hWnd);
 
              DeleteDC(RemoteDC);
              RemoteDC = CreateCompatibleDC(ThisDC);
              DeleteObject(hbitmap);
              hbitmap= CreateCompatibleBitmap(ThisDC, cBitmap.bmWidth, cBitmap.bmHeight);
 
              SelectObject(RemoteDC, hbitmap);
 
              ReleaseDC(hWnd, ThisDC);
 
 
 
              BITMAPINFO bi;
              HBITMAP hbmap;
              int bisize = sizeof(BITMAPINFO);
              memcpy(&bi, chIncomingDataBuffer+iEnd, bisize );
              SetDIBits(RemoteDC, hbitmap, 0,  cBitmap.bmHeight, chIncomingDataBuffer+iEnd+bisize,  &bi, DIB_RGB_COLORS);
 
 
              InvalidateRect(hWnd, NULL, false);

can anyone tell me..where I am wrong?
QuestionRe: Bitmap Display from Buffer received by TCP socket Pin
CPallini6-Feb-13 2:20
mveCPallini6-Feb-13 2:20 
AnswerRe: Bitmap Display from Buffer received by TCP socket Pin
Richard MacCutchan6-Feb-13 3:09
mveRichard MacCutchan6-Feb-13 3:09 
Questionicon on button not displayed in XP. Pin
VCProgrammer5-Feb-13 21:47
VCProgrammer5-Feb-13 21:47 
SuggestionRe: icon on button not displayed in XP. Pin
Richard MacCutchan6-Feb-13 3:11
mveRichard MacCutchan6-Feb-13 3:11 
QuestionRe: icon on button not displayed in XP. Pin
David Crow6-Feb-13 5:58
David Crow6-Feb-13 5:58 
AnswerRe: icon on button not displayed in XP. Pin
VCProgrammer6-Feb-13 17:36
VCProgrammer6-Feb-13 17:36 
SuggestionRe: icon on button not displayed in XP. Pin
David Crow7-Feb-13 2:35
David Crow7-Feb-13 2:35 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer7-Feb-13 18:46
VCProgrammer7-Feb-13 18:46 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan7-Feb-13 23:07
mveRichard MacCutchan7-Feb-13 23:07 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer7-Feb-13 23:52
VCProgrammer7-Feb-13 23:52 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan8-Feb-13 0:37
mveRichard MacCutchan8-Feb-13 0:37 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer8-Feb-13 1:15
VCProgrammer8-Feb-13 1:15 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan8-Feb-13 1:21
mveRichard MacCutchan8-Feb-13 1:21 
JokeRe: icon on button not displayed in XP. Pin
David Crow8-Feb-13 2:38
David Crow8-Feb-13 2:38 
JokeRe: icon on button not displayed in XP. Pin
Richard MacCutchan8-Feb-13 5:16
mveRichard MacCutchan8-Feb-13 5:16 
GeneralRe: icon on button not displayed in XP. Pin
VCProgrammer8-Feb-13 20:33
VCProgrammer8-Feb-13 20:33 
GeneralRe: icon on button not displayed in XP. Pin
Richard MacCutchan8-Feb-13 22:42
mveRichard MacCutchan8-Feb-13 22:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.