Link to home
Start Free TrialLog in
Avatar of vcl
vcl

asked on

What message's next, after WM_INITDIALOG?

Dear Expert-Exchange Community,

QUESTION 1 of 2:
-----------------------------
Background:
I am programming in MFC (using the class wizards and etc.) using VC5++ on the NT(4.0) platform. My software's framework is of a dialog based type. The software I'm writing is of an image-analysis nature (application - Industrial Automation) and it has to interface with a machine's handler. I have simulated this dialog base framework such that it has a main menu and looks just exactly like an SDI.

Question:
To initialize my dialog's values, I've trapped the WM_INITDIALOG message and added all the necessary things I need to do there. Then, in the main class, I call dlg.DoModal().

What is the next message to trap after the dialog has been displayed? Because I need to invoke a function which I declared (eg: myFunction() )after the dialog has been displayed. How do I do that?

See.... once the dialog box is displayed, I have to invoke MyFunction(), without any user intervention. MyFunction() contains a while-loop which keeps detecting an external machine's trigger (signal) and if I detect a trigger from this
machine, I have to perform certain image-analysis operations.

Aside:
Initially, I tried to call MyFunction() inside OnInitDialog() but since MyFunction contains a while-loop, I never got to see my dialog displayed since calling MyFunction() has send the program into a while-loop. (further illustration below)

OnInitDialog()
{
    .........
    .......
    MyFunction();   // By placing this function here,
                             // I was unable to visually see the
                             // dialog which I have created.
    return(TRUE);
}



QUESTION 2 of 2:
------------------------------

First, I am not sure what you call that box that pops up right in the middle of the screen to inform the user to wait while some task is being perform and it takes some time (and I'm not referring to the box with a progress bar.. just somthing simple)

Secondly, I want to be able to do that. How do I go about doing it. Can you please give me some starting points (ie: what classes to look up). I know I cannot use AfxMessageBox or the CWnd's Message Box bec both needs user response, which I don't want.

What I need is to achieve is described below in a simple pseudo-code.

(please refer to Q1 for the Background to this question)

OnPerformSomeFunction()
{
        - Display the PopUp Box right in the middle of the                   screen
        - Perform a time consuming task
        - Once, task is completed, repaint the screen
          so that the popup box disappear.
}


Thanking You for you time in advance.



Vivien A.
ASKER CERTIFIED SOLUTION
Avatar of rajesh032097
rajesh032097

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vcl
vcl

ASKER

Thanks, Raj, for getting to my questions so quickly. I will try it out and get back to you if I have any questions.

All The Best,
Vivien A.