Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

help in output!!

Posted on 2004-04-17
4
Medium Priority
?
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 252 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 248 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

670 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