Click here to Skip to main content
15,921,467 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: copy constructor of a derived class Pin
Balkrishna Talele18-Apr-04 20:52
Balkrishna Talele18-Apr-04 20:52 
GeneralRe: copy constructor of a derived class Pin
Jiten D. Gandhi18-Apr-04 20:57
Jiten D. Gandhi18-Apr-04 20:57 
GeneralRe: copy constructor of a derived class Pin
toxcct18-Apr-04 21:23
toxcct18-Apr-04 21:23 
QuestionHow shall i use the DLL Pin
NewtonOfComputers18-Apr-04 19:58
NewtonOfComputers18-Apr-04 19:58 
AnswerRe: How shall i use the DLL Pin
Balkrishna Talele18-Apr-04 20:30
Balkrishna Talele18-Apr-04 20:30 
GeneralVirtual COM Port to USB Pin
Daryl Ng18-Apr-04 19:45
sussDaryl Ng18-Apr-04 19:45 
GeneralRe: Virtual COM Port to USB Pin
Antony M Kancidrowski19-Apr-04 4:17
Antony M Kancidrowski19-Apr-04 4:17 
GeneralWinXP and ATL-CTRL-DEL and GDI problem Pin
Balkrishna Talele18-Apr-04 19:17
Balkrishna Talele18-Apr-04 19:17 
When I create thread and the at some part of the dialog or toolbar or anything I am drawing the things go well, It has to go well. But when I press Atl-Ctrl-Del(i.e I lock the computer) it stops drawing and after I release from locked state to normal state it dosent get the Handle to Device HDC and it stops painting. If any one encounter such problem, what should be the solution.

I have applied three different methods to solve this technique and it works but I am not satisfied. If I am unfortunately wrong , do let me know.

1) Before I entered The loop I write SaveDC(HDC) and when I am in loop of painting I check for locked state and I write RestoreDC(HDC,handle), it works but there is handsome memory and GDI leaks…It need to free the prev font and create font again and other init procedure
2) I write try ..throw catch and have to wait (Sleep(1) )for un-necessay time to keep on checking if I am getting HDC using GetDCEx(…); still it need to recreate font and other init once again.
3) This works if any one is stucked, without any leak

What WinXP does is it lock the window, so we cannot draw, the error code we get is GetLasterror=5 ie Access Denied.. and in that loop if we Write ::MessageBox(0,”Your message goes here”,”Error”,0); and don’t do the previous sucks…it again starts painting and any new cleanups and initializations…
Here my code goes

CreateFont(…)
GetDCEx(…DCX_LOCKWINDOWUPDATE)
While(EndTheLoop) // end the loop is 1
{
.
.
//example if I am drawing line or scrolling text
While((::TextOut(hdc,”Text”,5…)==0)
{
Sleep(1) //similarly for other HDC I keep on checking and sleeping
}

I am trying it in ATL Tool Bar and SDK Dialog Drawing, It works on win9x/2000 and dosent work on XP
Any other wise solution will be acknowledge



GeneralRe: WinXP and ATL-CTRL-DEL and GDI problem Pin
Blake Miller19-Apr-04 8:46
Blake Miller19-Apr-04 8:46 
GeneralRe: WinXP and ATL-CTRL-DEL and GDI problem Pin
Balkrishna Talele19-Apr-04 18:11
Balkrishna Talele19-Apr-04 18:11 
GeneralCHM viewer window Pin
soggie18-Apr-04 17:23
soggie18-Apr-04 17:23 
GeneralReversi source code Pin
Anonymous18-Apr-04 16:34
Anonymous18-Apr-04 16:34 
GeneralRe: Reversi source code Pin
parths18-Apr-04 17:44
parths18-Apr-04 17:44 
GeneralAbout *.lib and *.dll Pin
_David_Lee_18-Apr-04 16:04
_David_Lee_18-Apr-04 16:04 
GeneralRe: About *.lib and *.dll Pin
Hesham Amin18-Apr-04 22:14
Hesham Amin18-Apr-04 22:14 
QuestionGot CodeBlock? Pin
Dassatar18-Apr-04 15:29
Dassatar18-Apr-04 15:29 
AnswerRe: Got CodeBlock? Pin
soggie18-Apr-04 19:30
soggie18-Apr-04 19:30 
GeneralRe: Got CodeBlock? Pin
Balkrishna Talele18-Apr-04 21:22
Balkrishna Talele18-Apr-04 21:22 
GeneralRe: Got CodeBlock? Pin
Dassatar19-Apr-04 2:25
Dassatar19-Apr-04 2:25 
QuestionWhat API do I use to automate IIS manager tasks? Pin
Terry O'Nolley18-Apr-04 12:40
Terry O'Nolley18-Apr-04 12:40 
AnswerRe: What API do I use to automate IIS manager tasks? Pin
22491719-Apr-04 0:27
22491719-Apr-04 0:27 
AnswerRe: What API do I use to automate IIS manager tasks? Pin
22491719-Apr-04 1:24
22491719-Apr-04 1:24 
GeneralRe: What API do I use to automate IIS manager tasks? Pin
Terry O'Nolley19-Apr-04 5:52
Terry O'Nolley19-Apr-04 5:52 
GeneralSubstring extraction in DOS Pin
Ravi Bhavnani18-Apr-04 8:52
professionalRavi Bhavnani18-Apr-04 8:52 
GeneralRe: Substring extraction in DOS Pin
PJ Arends18-Apr-04 9:45
professionalPJ Arends18-Apr-04 9:45 

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.