Click here to Skip to main content
15,885,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Any fast and efficient compress/decompress code? Pin
Anthony Mushrow26-Jan-11 7:41
professionalAnthony Mushrow26-Jan-11 7:41 
AnswerRe: Any fast and efficient compress/decompress code? Pin
Rolf Kristensen26-Jan-11 8:45
Rolf Kristensen26-Jan-11 8:45 
QuestionCapturing stdout from an external program Pin
piul26-Jan-11 3:50
piul26-Jan-11 3:50 
AnswerRe: Capturing stdout from an external program Pin
David Crow26-Jan-11 3:55
David Crow26-Jan-11 3:55 
GeneralRe: Capturing stdout from an external program Pin
piul26-Jan-11 4:43
piul26-Jan-11 4:43 
GeneralRe: Capturing stdout from an external program Pin
David Crow26-Jan-11 5:40
David Crow26-Jan-11 5:40 
QuestionHow to get a CBitmap from a LPDIRECTDRAWSURFACE7 [Solved] Pin
kagelind26-Jan-11 3:01
kagelind26-Jan-11 3:01 
AnswerRe: How to get a CBitmap from a LPDIRECTDRAWSURFACE7 Pin
Code-o-mat26-Jan-11 7:54
Code-o-mat26-Jan-11 7:54 
Try something like this:
1. Use IDirectDrawSurface7::GetSurfaceDesc[^] to get the dimensions of the surface.
2. Use IDirectDrawSurface7::GetDC[^] to get a device context for the surface
3. Use CBitmap::CreateCompatibleBitmap[^], specify the DC you got from the surface, you might use CDC:Attach[^] to get a CDC from the HDC, just don't forget to also Detach it before releasing the DC. The dimensions for your bitmap you got in step 2.
4. Create a DC compatible with the surface DC using CDC::CreateCompatibleDC[^]
5. Select the bitmap you created in step 3 into the DC you created in step 4. Do a bit-block-transfer with CDC::BitBlt[^] to move the pixel data from the DC you got in step 2 to the DC you got in step 4.
6. Deselect the bitmap (3) from the DC (4), destroy the DC (4)
7. Use IDirectDrawSurface7::ReleaseDC[^] to free up the DC you got in step 2.
8. Live happily ever after.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<

GeneralRe: How to get a CBitmap from a LPDIRECTDRAWSURFACE7 Pin
kagelind26-Jan-11 23:35
kagelind26-Jan-11 23:35 
GeneralRe: How to get a CBitmap from a LPDIRECTDRAWSURFACE7 Pin
Code-o-mat26-Jan-11 23:41
Code-o-mat26-Jan-11 23:41 
GeneralRe: How to get a CBitmap from a LPDIRECTDRAWSURFACE7 Pin
Code-o-mat26-Jan-11 23:44
Code-o-mat26-Jan-11 23:44 
GeneralRe: How to get a CBitmap from a LPDIRECTDRAWSURFACE7 Pin
kagelind27-Jan-11 2:28
kagelind27-Jan-11 2:28 
GeneralRe: How to get a CBitmap from a LPDIRECTDRAWSURFACE7 Pin
Code-o-mat27-Jan-11 2:36
Code-o-mat27-Jan-11 2:36 
GeneralRe: How to get a CBitmap from a LPDIRECTDRAWSURFACE7 Pin
kagelind27-Jan-11 4:08
kagelind27-Jan-11 4:08 
GeneralRe: How to get a CBitmap from a LPDIRECTDRAWSURFACE7 Pin
Code-o-mat27-Jan-11 4:11
Code-o-mat27-Jan-11 4:11 
QuestionIs there simple open source compiler code? Pin
yu-jian26-Jan-11 0:03
yu-jian26-Jan-11 0:03 
AnswerRe: Is there simple open source compiler code? Pin
CPallini26-Jan-11 0:13
mveCPallini26-Jan-11 0:13 
AnswerRe: Is there simple open source compiler code? Pin
Niklas L26-Jan-11 23:30
Niklas L26-Jan-11 23:30 
QuestionString Conversion Pin
Mike Certini25-Jan-11 16:11
Mike Certini25-Jan-11 16:11 
AnswerRe: String Conversion Pin
Mike Certini25-Jan-11 17:28
Mike Certini25-Jan-11 17:28 
GeneralRe: String Conversion Pin
Andrew Brock25-Jan-11 21:56
Andrew Brock25-Jan-11 21:56 
AnswerRe: String Conversion Pin
Stefan_Lang27-Jan-11 3:28
Stefan_Lang27-Jan-11 3:28 
QuestionConvert String Pin
DraC_fri25-Jan-11 12:47
DraC_fri25-Jan-11 12:47 
AnswerRe: Convert String Pin
Yusuf25-Jan-11 13:22
Yusuf25-Jan-11 13:22 
AnswerRe: Convert String Pin
Luc Pattyn25-Jan-11 13:23
sitebuilderLuc Pattyn25-Jan-11 13:23 

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.