I spent a lot of time trying to find out why "Message Box'
made my program act like it crashed. Originally I had to
bring up the Task Manager every time I allowed "Message
Box' to run to shut down the program. After much
experimentation I found that if I hit the "Alt" key,
the MB would show on the screen. "OK"ing the MB allowed
my program to proceed normally. All along I suspected
a focus problem but since MB is a black box, I had no
idea what was happening. By pure chance, I put a little
TextOut code snippet into the function. I do this to
see what's going on inside functions quite a bit. With
these four lines of code, MB started working normally.
This is exactly the same solution to the SetTimer
problem I had posted a thread about in this site a week
or so back. It bothers me that I need a BeginPaint and
EndPaint entry to prevent strange things from happening
in my programs. I can force things to work right with
a fudge but that's not right. I'd sure like one of you
experts to tell me why this is occurring. I'm
running AMD with SP1. Compiling with either "cl" or
BCC55 gives me the same results. I'll include a small
program with the code in it so you can compile and
test to see what I'm talking about.
toolmanx
0
Light Poster
Recommended Answers
Jump to PostWell I thought I made it fairly clear in your previous thread TBH.
The timer doesn't work without the paint code in MyTimerFunc() because you don't handle WM_PAINT, so the window is not validated and the high frequency (and priority) of WM_PAINT messages blocks the low priority WM_TIMER message.
Just …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.