Help with this code

This is a discussion on Help with this code within the C++ Programming forums, part of the General Programming Boards category; { // copy doublebuffer to window HDC hdc = GetDC(hMainWnd); BitBlt(hdc,0,0,256,32,memDC,0,0,SRCCOPY); ReleaseDC(hMainWnd,hdc); } ok what does this code snippet it ...

  1. #1
    Unregistered
    Guest

    Help with this code

    { // copy doublebuffer to window
    HDC hdc = GetDC(hMainWnd);
    BitBlt(hdc,0,0,256,32,memDC,0,0,SRCCOPY);
    ReleaseDC(hMainWnd,hdc);
    }

    ok what does this code snippet it do I know what it does within the braket flips the back buffer but um why is it in the brackets by itself

    it goes
    blah
    blah
    blah
    {
    the stuff up there in here
    }
    blah
    blah

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    It's probably in its own block because the coder wanted hdc to be a local variable to that area, the possibility is also there that one of the lines caused problems while in scope with the rest of the function and a block was thrown around the piece of code to isolate it and fix the problem.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extended ASCII Characters in an RTF Control
    By JustMax in forum C Programming
    Replies: 18
    Last Post: 04-03-2009, 09:20 PM
  2. Enforcing Machine Code Restrictions?
    By SMurf in forum Tech Board
    Replies: 21
    Last Post: 03-30-2009, 08:34 AM
  3. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 06:06 PM
  5. Replies: 0
    Last Post: 02-21-2002, 06:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21