Click here to Skip to main content
15,120,078 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: migration from c++ 6 to Visual stutio professional 2010 Pin
mrby12319-Mar-12 9:26
Membermrby12319-Mar-12 9:26 
GeneralRe: migration from c++ 6 to Visual stutio professional 2010 Pin
mrby12319-Mar-12 16:47
Membermrby12319-Mar-12 16:47 
AnswerRe: migration from c++ 6 to Visual stutio professional 2010 Pin
Albert Holguin19-Mar-12 17:18
professionalAlbert Holguin19-Mar-12 17:18 
GeneralRe: migration from c++ 6 to Visual stutio professional 2010 Pin
mrby12319-Mar-12 17:26
Membermrby12319-Mar-12 17:26 
QuestionFunction Overloading Pin
Amrit Agr18-Mar-12 6:46
MemberAmrit Agr18-Mar-12 6:46 
AnswerRe: Function Overloading Pin
jschell18-Mar-12 8:19
Memberjschell18-Mar-12 8:19 
AnswerRe: Function Overloading Pin
smags1319-Mar-12 10:25
Membersmags1319-Mar-12 10:25 
QuestionProblem with drawing using GDI functions... Pin
Rozis18-Mar-12 1:52
MemberRozis18-Mar-12 1:52 
XML
I've created an application that paints on the window using GDI functions. It works fine. But because it is still under development it sometimes craches. It seems that if there are certain craches Windows Vista suddenly decides to treat my application in a new way: while drawing on the window it decides it must redraw that was on the screen when i started my application. The effect is that some drawing is lost. Windows continues with this behavour till i reboot my pc. After i booted the same piece of code draws the window correctly. I used Spy++ to find out what's happening. When the window is correctly displayed i see the following:

<00037> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1215 yPos:640
<00038> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1215 yPos:640
<00039> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1249 yPos:711
<00040> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1249 yPos:711

(I press the mousebutton to start drawing, it draws the window, i press the mousebutton again to close the window)

When things go wrong Spy++ reports the following:

<00037> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1219 yPos:643
<00038> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1219 yPos:643
<00039> 004904B2 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00040> 004904B2 R WM_WINDOWPOSCHANGING
<00041> 004F0646 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00042> 004F0646 R WM_WINDOWPOSCHANGING
<00043> 00340626 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00044> 00340626 R WM_WINDOWPOSCHANGING
<00045> 004904B2 S WM_WINDOWPOSCHANGED lpwp:0012FE20
<00046> 004904B2 R WM_WINDOWPOSCHANGED
<00047> 004F0646 S WM_WINDOWPOSCHANGED lpwp:0012FE20
<00048> 004F0646 R WM_WINDOWPOSCHANGED
<00049> 00340626 S WM_WINDOWPOSCHANGED lpwp:0012FE20
<00050> 00340626 S .WM_SIZE fwSizeType:SIZE_RESTORED nWidth:1280 nHeight:770
<00051> 00340626 R .WM_SIZE
<00052> 00340626 R WM_WINDOWPOSCHANGED
<00053> 004904B2 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00054> 004904B2 R WM_WINDOWPOSCHANGING
<00055> 004F0646 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00056> 004F0646 R WM_WINDOWPOSCHANGING
<00057> 00340626 S WM_WINDOWPOSCHANGING lpwp:0012FE20
<00058> 00340626 R WM_WINDOWPOSCHANGING
<00059> 00340626 P WM_PAINT hdc:00000000
<00060> 00340626 S WM_ERASEBKGND hdc:D1011D9A
<00061> 00340626 R WM_ERASEBKGND fErased:False
<00062> 00340626 S WM_GETICON fType:True
<00063> 00340626 R WM_GETICON hicon:1CA203B1
<00064> 00340626 S WM_GETICON fType:False
<00065> 00340626 R WM_GETICON hicon:00000000
<00066> 00340626 S WM_GETICON fType:True
<00067> 00340626 R WM_GETICON hicon:089A0417
<00068> 00340626 P WM_LBUTTONDOWN fwKeys:MK_LBUTTON xPos:1252 yPos:726
<00069> 00340626 P WM_LBUTTONUP fwKeys:0000 xPos:1252 yPos:726

The big difference is lines numbered 39-67. Does anyone understand what's happening here? And what is a correct solution for this problem? What causes it? It seems that i have to intercept the paint message to tell Windows to shut up. But what worries me is that the hdc is 0. 

Any help will be appreciated..

AnswerRe: Problem with drawing using GDI functions... Pin
Albert Holguin18-Mar-12 18:09
professionalAlbert Holguin18-Mar-12 18:09 
QuestionSecure erase command implementation Pin
K4HVDs18-Mar-12 1:19
MemberK4HVDs18-Mar-12 1:19 
AnswerRe: Secure erase command implementation Pin
jschell18-Mar-12 8:23
Memberjschell18-Mar-12 8:23 
AnswerRe: Secure erase command implementation Pin
Albert Holguin18-Mar-12 18:28
professionalAlbert Holguin18-Mar-12 18:28 
QuestionMultiple threads in MFC Pin
K4HVDs18-Mar-12 1:15
MemberK4HVDs18-Mar-12 1:15 
AnswerRe: Multiple threads in MFC Pin
Jochen Arndt18-Mar-12 2:23
professionalJochen Arndt18-Mar-12 2:23 
AnswerRe: Multiple threads in MFC Pin
Rajesh R Subramanian18-Mar-12 3:47
professionalRajesh R Subramanian18-Mar-12 3:47 
AnswerRe: Multiple threads in MFC Pin
Albert Holguin18-Mar-12 18:13
professionalAlbert Holguin18-Mar-12 18:13 
QuestionLittle advice of CFront Pin
Brandon-X1200017-Mar-12 18:13
MemberBrandon-X1200017-Mar-12 18:13 
AnswerRe: Little advice of CFront Pin
Richard MacCutchan17-Mar-12 23:07
mveRichard MacCutchan17-Mar-12 23:07 
GeneralRe: Little advice of CFront Pin
Brandon-X1200018-Mar-12 0:22
MemberBrandon-X1200018-Mar-12 0:22 
GeneralRe: Little advice of CFront Pin
Richard MacCutchan18-Mar-12 3:14
mveRichard MacCutchan18-Mar-12 3:14 
GeneralRe: Little advice of CFront Pin
Brandon-X1200018-Mar-12 7:39
MemberBrandon-X1200018-Mar-12 7:39 
GeneralRe: Little advice of CFront Pin
Richard MacCutchan18-Mar-12 23:31
mveRichard MacCutchan18-Mar-12 23:31 
GeneralRe: Little advice of CFront Pin
Brandon-X1200020-Mar-12 11:09
MemberBrandon-X1200020-Mar-12 11:09 
AnswerRe: Little advice of CFront Pin
markkuk18-Mar-12 1:08
Membermarkkuk18-Mar-12 1:08 
GeneralRe: Little advice of CFront Pin
Brandon-X1200018-Mar-12 7:45
MemberBrandon-X1200018-Mar-12 7: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.