Click here to Skip to main content
15,904,652 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: __interface implies the novtable __declspec modifier Pin
bob1697210-Feb-13 6:03
bob1697210-Feb-13 6:03 
GeneralRe: __interface implies the novtable __declspec modifier Pin
pasztorpisti10-Feb-13 10:45
pasztorpisti10-Feb-13 10:45 
GeneralRe: __interface implies the novtable __declspec modifier Pin
bob1697210-Feb-13 19:22
bob1697210-Feb-13 19:22 
GeneralRe: __interface implies the novtable __declspec modifier Pin
H.Brydon11-Feb-13 15:45
professionalH.Brydon11-Feb-13 15:45 
GeneralRe: __interface implies the novtable __declspec modifier Pin
pasztorpisti12-Feb-13 4:53
pasztorpisti12-Feb-13 4:53 
QuestionAES Encryption Help Pin
vishalgpt7-Feb-13 23:21
vishalgpt7-Feb-13 23:21 
AnswerRe: AES Encryption Help Pin
Richard MacCutchan8-Feb-13 0:34
mveRichard MacCutchan8-Feb-13 0:34 
GeneralRe: AES Encryption Help Pin
vishalgpt8-Feb-13 2:55
vishalgpt8-Feb-13 2:55 
GeneralRe: AES Encryption Help Pin
Richard MacCutchan8-Feb-13 5:22
mveRichard MacCutchan8-Feb-13 5:22 
QuestionKernel programming Pin
OmarSH7-Feb-13 22:15
OmarSH7-Feb-13 22:15 
AnswerRe: Kernel programming Pin
Richard MacCutchan7-Feb-13 23:08
mveRichard MacCutchan7-Feb-13 23:08 
GeneralRe: Kernel programming Pin
OmarSH7-Feb-13 23:49
OmarSH7-Feb-13 23:49 
GeneralRe: Kernel programming Pin
Richard MacCutchan8-Feb-13 0:32
mveRichard MacCutchan8-Feb-13 0:32 
GeneralRe: Kernel programming Pin
OmarSH8-Feb-13 2:11
OmarSH8-Feb-13 2:11 
GeneralRe: Kernel programming Pin
Richard MacCutchan8-Feb-13 5:15
mveRichard MacCutchan8-Feb-13 5:15 
AnswerRe: Kernel programming Pin
Erudite_Eric8-Feb-13 0:09
Erudite_Eric8-Feb-13 0:09 
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 

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.