Click here to Skip to main content
16,004,977 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questiondeclaring const strings Pin
Chintoo7232-Oct-05 6:28
Chintoo7232-Oct-05 6:28 
AnswerRe: declaring const strings Pin
LighthouseJ2-Oct-05 7:28
LighthouseJ2-Oct-05 7:28 
AnswerRe: declaring const strings Pin
Rage_bla2-Oct-05 7:40
Rage_bla2-Oct-05 7:40 
AnswerRe: declaring const strings Pin
Rick York2-Oct-05 11:18
mveRick York2-Oct-05 11:18 
QuestionSimple GDI Problem Pin
LighthouseJ2-Oct-05 5:39
LighthouseJ2-Oct-05 5:39 
GeneralRe: Simple GDI Problem Pin
Anton Mikhalyov2-Oct-05 7:55
Anton Mikhalyov2-Oct-05 7:55 
GeneralRe: Simple GDI Problem Pin
LighthouseJ2-Oct-05 15:55
LighthouseJ2-Oct-05 15:55 
AnswerRe: Simple GDI Problem Pin
Jose Lamas Rios2-Oct-05 9:30
Jose Lamas Rios2-Oct-05 9:30 
The problem is that the area in which you are drawing is not 'invalidated'. Breaking into the debugger has the side-effect of invalidating the entire window and that's why it works fine after that. Whenever you change the info, which by the way should be in your document instead of your view, you need to make the view invalidate the area that needs to be updated.

Take a look at this post[^] for more details on how to orchestrate the interaction between the document and its views.

Also, instead of this:
   char * lpszText = new char[32];
   sprintf (lpszText, "Files: %u", files->GetCount());
   int nTextHeight = dc.DrawText(lpszText, [...] );
   delete[] lpszText;

I suggest this:
   CString sText;
   sText.Format("Files: %u", files->GetCount());
   int nTextHeight = dc.DrawText(sText, [...] );

It's cleaner, you don't need to worry about how much space to allocate, and you don't risk forgetting to free it.


--
jlr
http://jlamas.blogspot.com/[^]
GeneralRe: Simple GDI Problem Pin
LighthouseJ2-Oct-05 15:57
LighthouseJ2-Oct-05 15:57 
QuestionNotifaction Area Pin
G Cross2-Oct-05 5:26
G Cross2-Oct-05 5:26 
AnswerRe: Notifaction Area Pin
ThatsAlok2-Oct-05 18:24
ThatsAlok2-Oct-05 18:24 
Questionconfused Pin
benjnp2-Oct-05 5:12
benjnp2-Oct-05 5:12 
QuestionWhich database access tech to use? Pin
Shao Voon Wong2-Oct-05 3:12
mvaShao Voon Wong2-Oct-05 3:12 
AnswerRe: Which database access tech to use? Pin
Ghasrfakhri2-Oct-05 3:22
Ghasrfakhri2-Oct-05 3:22 
GeneralRe: Which database access tech to use? Pin
Shao Voon Wong2-Oct-05 3:37
mvaShao Voon Wong2-Oct-05 3:37 
GeneralRe: Which database access tech to use? Pin
Ghasrfakhri2-Oct-05 10:53
Ghasrfakhri2-Oct-05 10:53 
GeneralRe: Which database access tech to use? Pin
Shao Voon Wong2-Oct-05 18:12
mvaShao Voon Wong2-Oct-05 18:12 
GeneralRe: Which database access tech to use? Pin
David Crow3-Oct-05 3:01
David Crow3-Oct-05 3:01 
AnswerRe: Which database access tech to use? Pin
toxcct2-Oct-05 3:58
toxcct2-Oct-05 3:58 
GeneralRe: Which database access tech to use? Pin
Shao Voon Wong2-Oct-05 18:16
mvaShao Voon Wong2-Oct-05 18:16 
GeneralRe: Which database access tech to use? Pin
toxcct2-Oct-05 21:11
toxcct2-Oct-05 21:11 
AnswerRe: Which database access tech to use? Pin
John M. Drescher2-Oct-05 6:27
John M. Drescher2-Oct-05 6:27 
GeneralRe: Which database access tech to use? Pin
Shao Voon Wong2-Oct-05 18:18
mvaShao Voon Wong2-Oct-05 18:18 
AnswerRe: Which database access tech to use? Pin
S Douglas2-Oct-05 23:53
professionalS Douglas2-Oct-05 23:53 
AnswerRe: Which database access tech to use? Pin
Nemanja Trifunovic2-Oct-05 9:56
Nemanja Trifunovic2-Oct-05 9:56 

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.