Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Message box won't stay on screen

Options
  • 04-12-2007 6:06pm
    #1
    Registered Users Posts: 5,949 ✭✭✭


    What can I do to get the output of a c++ program to remain on the screen for more than a split second. I'm making a program to call a run-time dll which displays the current time on the screen, but when I compile it the black output screen flashes for a split second on the screen. How do I get it to stay for longer? No errors or warnings or reported. The lines of text referring to a message box in the call program are;

    MessageBox(NULL,"Error loading DLL","",MB_OK);

    and in the DLL there are two message boxes;

    MessageBox(NULL,displaytime,"DLL for current time and date",MB_OK);
    MessageBox(NULL,TEXT,"The Current Time is",MB_OK);

    Anyone know what usually causes this? Will it be useful to post the full code?


Comments

  • Closed Accounts Posts: 311 ✭✭auggie2k


    #include<iostream>

    int main()
    {
    while(true)
    {
    std::cout << "Press enter key";

    if(std::cin.peek() == '\n') // looks to see if the next character in the
    standard input stream is enter
    {
    std::cin.ignore(1000,'\n'); // clear the stream
    break; // break the loop
    }
    else
    {
    std::cin.ignore(1000, '\n');
    continue;
    }
    }

    std::cout << "while broken";

    return 0;
    }


Advertisement