Solved

help in output!!

Posted on 2004-04-17
4
155 Views
Last Modified: 2010-04-24
hai,
   i have done my coding in VC++6.0, i don't have any errors in my coding ,but the problem is as soon as i give the input to the dialog box that i have created  and i press enter the screen dissappears?!!i had tried using cout before opeing the dialog box,but that too in vain as no dos screen appears?!!do i need to do any settings in VC++ ?please help me..

vijay
0
Comment
Question by:vijay79
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 63 total points
ID: 10859159
This is standard dialog behaviour. To prevent closing dialog by Enter and Esc keys overwrite PreTranslateMessage:

BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
    if( pMsg->message == WM_KEYDOWN )
    {
        if( pMsg->wParam == VK_RETURN ||  pMsg->wParam == VK_ESCAPE )
        {
            ::TranslateMessage(pMsg);
            ::DispatchMessage(pMsg);
            return TRUE;
        }
    }
      
    return CDialog::PreTranslateMessage(pMsg);
}
0
 
LVL 16

Assisted Solution

by:nonubik
nonubik earned 62 total points
ID: 11489825
I hope no one will be disturbed by my (late) comment, but I recently had a similar problem. In my case the escape was overriding CMyDialog::OnOk() without calling CDialog::OnOk() (base class method).
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now