Click here to Skip to main content
15,884,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: A default MFC project don't use /Yc compiler option, how does it work? Pin
Stuart Dootson23-Mar-09 0:39
professionalStuart Dootson23-Mar-09 0:39 
QuestionTimer or For Loop Help. Pin
FISH78621-Mar-09 13:36
FISH78621-Mar-09 13:36 
AnswerRe: Timer or For Loop Help. Pin
Code-o-mat21-Mar-09 23:42
Code-o-mat21-Mar-09 23:42 
GeneralRe: Timer or For Loop Help. Pin
FISH78622-Mar-09 0:23
FISH78622-Mar-09 0:23 
GeneralRe: Timer or For Loop Help. Pin
Code-o-mat22-Mar-09 0:50
Code-o-mat22-Mar-09 0:50 
GeneralRe: Timer or For Loop Help. Pin
FISH78622-Mar-09 1:45
FISH78622-Mar-09 1:45 
GeneralRe: Timer or For Loop Help. Pin
Code-o-mat22-Mar-09 7:33
Code-o-mat22-Mar-09 7:33 
GeneralRe: Timer or For Loop Help. Pin
FISH78622-Mar-09 7:55
FISH78622-Mar-09 7:55 
Here is the section I am having problems with:

This is in a function of it's own:

Instead of using WindowFromPoint I am using hWnd that I have for the window
I am after since the user could have moved it.
POINT Textpt;
Textpt.x = a;
Textpt.y = c;
HDC DlgDC,MemDC,DeskDC;
int height, width;
HBRUSH hBrush;
HBITMAP hBitmap;
DlgDC = GetDC(hWnd);
DeskDC = GetDC(NULL);
hBrush = CreateSolidBrush(RGB(255,25,0));
width= 53;
height= 8;
MemDC = CreateCompatibleDC(DlgDC);
hBitmap = CreateCompatibleBitmap(DlgDC,width,height);
SelectObject(MemDC,hBitmap);
BitBlt(MemDC,0,0,width,height ,DeskDC,Textpt.x,Textpt.y,SRCCOPY);
////
Some processing....
Couple of If statements and geting color pixels.
////
after above is done processing->

ReleaseDC(NULL,MemDC);
DeleteObject(MemDC);
ReleaseDC(NULL,DlgDC);
DeleteObject(DlgDC);
ReleaseDC(NULL,DeskDC);
DeleteObject(DeskDC);

Please help if its wrong...
This is the only part that dies after 10 minutes. I ran this with the thread, I commented the rest of the app including the processing in between the above code.
I ran the thread own its own without the above it ran fine. All the thread was doing at that point was getting the handle to the window I am after.It ran for a long time.
Thanks a million.
GeneralRe: Timer or For Loop Help. Pin
Code-o-mat22-Mar-09 8:19
Code-o-mat22-Mar-09 8:19 
GeneralRe: Timer or For Loop Help. Pin
FISH78622-Mar-09 8:30
FISH78622-Mar-09 8:30 
GeneralRe: Timer or For Loop Help. Pin
FISH78622-Mar-09 10:28
FISH78622-Mar-09 10:28 
Questionhow to use in-place editing Pin
jiaweicz21-Mar-09 11:01
jiaweicz21-Mar-09 11:01 
AnswerRe: how to use in-place editing Pin
Yusuf21-Mar-09 13:02
Yusuf21-Mar-09 13:02 
QuestionXP/Vista Styles Pin
The_Judgement21-Mar-09 9:27
The_Judgement21-Mar-09 9:27 
AnswerRe: XP/Vista Styles Pin
Code-o-mat21-Mar-09 10:35
Code-o-mat21-Mar-09 10:35 
GeneralRe: XP/Vista Styles Pin
The_Judgement21-Mar-09 11:14
The_Judgement21-Mar-09 11:14 
GeneralRe: XP/Vista Styles Pin
Code-o-mat21-Mar-09 11:27
Code-o-mat21-Mar-09 11:27 
GeneralRe: XP/Vista Styles Pin
The_Judgement21-Mar-09 12:41
The_Judgement21-Mar-09 12:41 
GeneralRe: XP/Vista Styles Pin
Code-o-mat21-Mar-09 23:04
Code-o-mat21-Mar-09 23:04 
GeneralRe: XP/Vista Styles [modified] Pin
The_Judgement22-Mar-09 11:28
The_Judgement22-Mar-09 11:28 
QuestionUnicode.. Pin
p_196021-Mar-09 7:36
p_196021-Mar-09 7:36 
AnswerRe: Unicode.. Pin
CPallini21-Mar-09 7:48
mveCPallini21-Mar-09 7:48 
AnswerRe: Unicode.. Pin
Jörgen Sigvardsson21-Mar-09 22:43
Jörgen Sigvardsson21-Mar-09 22:43 
Questionconvert Pin
durban221-Mar-09 5:07
durban221-Mar-09 5:07 
QuestionRe: convert Pin
CPallini21-Mar-09 5:13
mveCPallini21-Mar-09 5:13 

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.