Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Message box

Reply
Thread Tools

Message box

 
 
Jonathan Mcdougall
Guest
Posts: n/a
 
      08-02-2003
On Sun, 3 Aug 2003 01:24:02 +0100, "Wawa"
<(E-Mail Removed)> wrote:

>Hi all,
>
>These are the best places I can find to ask this, I can't find a good Visual
>C++ ng.


This is no good place to ask this. comp.lang.c++ talks only about
Standard C++, which has nothing to do with Windows.

>In the 'WM_PAINT' event I call a routine to draw certain shapes. I have an
>MB_OK message box which pops up to indicate an error, and I want to suspend
>all action of the program (i.e. disable the event handler) until the the
>user acknowledges the message box by clicking 'Ok' or closing it.


<ot>

Well you could set a flag when an error message pops up and and check
this flag in the loop in WinMain.. that would be quite easy, no?

</ot>

Jonathan

 
Reply With Quote
 
 
 
 
Wawa
Guest
Posts: n/a
 
      08-03-2003
Hi all,

These are the best places I can find to ask this, I can't find a good Visual
C++ ng.

I've written a program in Visual C++, which is a board game, so has a fair
amount of input from the user.

In the 'WM_PAINT' event I call a routine to draw certain shapes. I have an
MB_OK message box which pops up to indicate an error, and I want to suspend
all action of the program (i.e. disable the event handler) until the the
user acknowledges the message box by clicking 'Ok' or closing it.

I tried using a 'do' loop with the message box successful return as the
condition, or an endless for loop with a break, etc., however, the event
queue still overrides the action, and the user can still click on the screen
and it goes into the 'WM_LBUTTONDOWN' event.

Is there a way I can fix this, short of setting a flag when the messagebox
is acknowleged, and putting an 'if' in all my events to check if the flag?

Thank in advance,
Wawa


 
Reply With Quote
 
 
 
 
Rolf Magnus
Guest
Posts: n/a
 
      08-03-2003
Wawa wrote:

> Hi all,
>
> These are the best places I can find to ask this, I can't find a good
> Visual C++ ng.


comp.lang.c++ is not the best place, since here, we only deal with the
C++ language as defined by the ISO standard, which doesn't cover
message boxes or anything that is system dependant.



 
Reply With Quote
 
Stephen Howe
Guest
Posts: n/a
 
      08-03-2003
> These are the best places I can find to ask this, I can't find a good
Visual
> C++ ng.


What, not even the 22+ VC++ newsgroups on Microsoft's own news server, not
counting even the non-English speaking VC++ newsgroups?
Visit News Server: msnews.microsoft.com

Stephen Howe


 
Reply With Quote
 
Wawa
Guest
Posts: n/a
 
      08-03-2003
> This is no good place to ask this. comp.lang.c++ talks only about
>Standard C++, which has nothing to do with Windows.


Do loops, while loops and flags are standard C, and that was the basis of my
post, but let's not get pedantic. There's so many newsgroups it's sometimes
hard to find an appropriate one, and people's reaction if you don't suceed
are never helpful.

>
> <ot>
>
> Well you could set a flag when an error message pops up and and check
> this flag in the loop in WinMain.. that would be quite easy, no?
>
> </ot>
>


In my original post I wrote:
"Is there a way I can fix this, short of setting a flag when the messagebox
is acknowleged, and putting an 'if' in all my events to check if the flag?"

so I had considered that option already.


 
Reply With Quote
 
Jonathan Mcdougall
Guest
Posts: n/a
 
      08-03-2003
On Sun, 3 Aug 2003 03:07:47 +0100, "Wawa"
<(E-Mail Removed)> wrote:

>> This is no good place to ask this. comp.lang.c++ talks only about
>>Standard C++, which has nothing to do with Windows.

>
>Do loops, while loops and flags are standard C,


You should choose wether you are programming in C++ or C.

>and that was the basis of my
>post, but let's not get pedantic. There's so many newsgroups it's sometimes
>hard to find an appropriate one, and people's reaction if you don't suceed
>are never helpful.


Suceeding is not that difficult. Just pick a newsgroup directly
related to your question. If your question is about loops and flags,
then it is welcomed here.

>> <ot>
>>
>> Well you could set a flag when an error message pops up and and check
>> this flag in the loop in WinMain.. that would be quite easy, no?
>>
>> </ot>
>>

>
>In my original post I wrote:
>"Is there a way I can fix this, short of setting a flag when the messagebox
>is acknowleged, and putting an 'if' in all my events to check if the flag?"
>
>so I had considered that option already.


To quote you myself :

"[..] and putting an 'if' in all my events to check if the flag?"

You only need to put the test in the main loop and that's it.
Basically, you want a 'pause' feature :

int main()
{
bool pause = false;

// main loop
while ( true )
{
if ( paused() ) pause = true;
if ( unpaused() ) pause = false;

if (pause) continue;

// other handling
}
}


If you want a solution which concerns the windows api, please do not
post in standard c++ newsgroups.


Jonathan

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
how to selecet check box in the data grid ?? only one check box mit ASP .Net 1 01-25-2006 06:47 PM
populate one list box with selected values from another list box steven.cooper@infocision.com ASP .Net 1 03-12-2005 11:29 PM
New to .NET, can I have one drop down box control the data of another drop down box using a database? SirPoonga ASP .Net 2 01-07-2005 10:44 PM
COMBO BOX INSTEAD OF DROP DOWN BOX =?Utf-8?B?QW5nZWw=?= ASP .Net 3 06-29-2004 06:38 PM



Advertisments