Solved

help in output!!

Posted on 2004-04-17
4
174 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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error when running console app 9 141
FTP Directory Listing 2 68
Need some help with listview limit text 20 103
Access to class from any project within a solution. 6 23
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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