Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

help in output!!

Posted on 2004-04-17
4
Medium Priority
?
203 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
2 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 video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

772 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