|
i'm a beginner in visual c++,i would like to know how can i prevent my application from Exiting when Enter Key is pressed at start-up.
|
|
|
|
|
Assuming your application is a dialog-based application, then pressing the enter key has the effect of pressing the default button, whichi by default is the OK button, which will cause your button to exit.
If you don't want it to exit, either don't press enter, or change which button is the default one.
If I'm way off then let us know a bit more about the nature of your application and I'm sure we can help
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
derek,
its a dialog-based application,i removed the OK button and placed the Exit function inside the Menu.
|
|
|
|
|
There is one another solution.
You can override OnOK function.
Simply add function:
void CYourDialog::OnOK()
{
}
And your problem disappearing...
--------------------------------------------------
Say Whatever You Know.
Helping other people is good for health.
=========
Manish
=========
---------------------------------------------------
|
|
|
|
|
Why on earth would you leave the button there if you're not going to have it do anything ? You might check in OnOK if return has been pressed, so it works only by pressing the button, but it's just as easy not to make it the default button.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I have defined a new message with "WM_USER+1".
I use "SendMessage" in View class and catch the message with its handler in Doc class. But it does not work.
But when I I use "SendMessage" in View class and catch the message with its handler in View class, it works perfectly.
How to catch the message in Doc class?
Thanks.
Maer
|
|
|
|
|
My MFC's a bit rusty, but I believe documents can only handle WM_COMMAND messages. A document isn't a window, so you can't send it arbitrary messages. A doc can handle WM_COMMAND, but only because MFC handles the message routing itself.
As an aside, you should define your own messages as WM_APP+x, not WM_USER+x, because some common controls use WM_USER. No control uses WM_APP so you are guaranteed not to run into any conflicts.
--Mike--
http://home.inreach.com/mdunn/
"Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent
your with and
|
|
|
|
|
Thanks.
Your suggestion is helpful.
|
|
|
|
|
Messages can only be sent to windows and document is not a window.
|
|
|
|
|
|
How can I specify a number is a hexadecimal number in a SQL statement while programming with ODBC?
Thanks.
|
|
|
|
|
You can't. The ODBC numeric literal syntax allows only decimal numbers, so you need to convert your numbers.
|
|
|
|
|
Thanks pal.
I think it is a shortcoming of ODBC that it does not support hexadecimal number, is that right?
Best regards.
Maer
|
|
|
|
|
|
i'm currently using visual C++ and i want to know the library and command to draw lines and boxes and fill the boxes with colours in win32......does anyone knows? Help me i'm really desperate!
jan
|
|
|
|
|
Win32 APIs: MoveTo, LineTo, Rectangle, FillRect
--Mike--
http://home.inreach.com/mdunn/
"Listen you footwarriors, can you hold down a bit with the firing? I've just got three impromptu weddings breaking out behind me!" -- Arthur Dent
your with and
|
|
|
|
|
If this relates to your earlier question, the answers provided there are still the case, you are going to have trouble if you're trying to draw to a console. You might also find it better NOT to SCREAM AT US, and to provide some clue to your problem in the question, rather than your personal level of urgency, which I'm sure is the same for everyone.
If you're now writing a Windows program ( one with a Window), then GDI is the way to go, and there is a plethora of documentation about it. Most on this site use MFC, so you'll probably need to go to MSDN to get info on doing it under Win32. Be VERY careful of your resources, it's very easy to crash a program under Win32 through leaking resources. Another good source is www.WDJ.com - the site has all the old article code for download and authors are not allowed to use MFC, so you'll find a fair bit of Win32 GDI code there. They do a graphics issue annually, so look for that for each year, and you should find some stuff that will help you. Obviously, if you get stuck, just ask.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I want to print data onto the NISCA printer using MFC.
vijaya.
|
|
|
|
|
(My first post here, this board is awesome.. tremendous thanks for all the tips from the guru's)
Hiya,
Does anyone have any tips on how to create custom slider controls? I want to put some slender popup sliders in an app I am developing. I think the generic sliders in MFC are fairly obnoxious.
Many thanks in advance,
Christian
"I have made this letter a rather long one, only because I didn't have the leisure to make it shorter."
-Blaise Pascal
|
|
|
|
|
Hi all,
I maked OLE object field in Access 2000 ...
Now, i wanna load and save my pictures from my field with ADO ...
How can i do that ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
|
Thank you Michael ...
That was great article ...
But i have problem still !!!
Because i can't create Long Binary field in Access 2000 !!!
How can i solve it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have written a custom control derived from CWnd. Basically I am not drawing the entire client rectangle. I do not want to obscure things behind the control. Now I have added the ability to click and drag a "thumb" piece on this control. Works great, except for the drawing.
What I am seeing is the control is not erasing the rectangle and I start getting "smearing"
Is there an easy way to grab an XOR map on this? I'm kinda new to MFC and am feeling my way through this.
Little help?
-JT
|
|
|
|
|
How can I send email from a program?
I would like to not have to go through an SMTP server.
On a related note, but off topic for this forum, I set up an SMTP server on my computer but when I tried to email my hotmail account through it, it said that it was 'unable to relay' for that email address. On the 'relay restrictions' page of the internet information services settings I have the 'Allow all computers which successfully authenticate to relay' check box checked.
Thank you for suggestions,
-Alex Griffing
|
|
|
|
|
See this:
http://www.codeproject.com/useritems/xymailclient.asp
I vote pro drink
|
|
|
|