|
You also need to add a new button (see my previous reply) with id IDC_DONE . That button's handler should eventually call CDialog::OnOK() .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
The new button is all very well. its the old OK button that doesnt want to be deleted or invisibled....and I really dont want a useless buttonaround...Really the enter behavior returns if you get rid of the OK button.
|
|
|
|
|
nss wrote:
ts the old OK button that doesnt want to be deleted or invisibled....
Sorry, I don't understand you're saying! There seems to be a disconnect between what you're trying and what's been suggested.
I've been doing the "get rid off the OK button and use a substitute" thing for years to provide precisely the behavior you want.
If you want, I can send you a little code example.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Let me try to explain more clearly. First I cleared out the OnOK() handler for my dlg class OK button. Then ran it - fine. No dismissal on Enter. Then added a done button, called CDialog::OnOK() in it. Works fine. Still no dismissal.
Then I deleted the old OK button and ran it. Hit enter! Viola - the dlg vanishes!
I'll email you my latest atttempt...
thanks for checking this out!
|
|
|
|
|
|
nss wrote:
Then I deleted the old OK button and ran it. Hit enter! Viola - the dlg vanishes!
Hitting Enter actually does one of two things:
1. If a push button has the focus, clicks that button.
2. If some other kind of control has the focus, clicks the default push button in the dialog.
It sounds like you saw one of those cases. Hitting Enter clicked your new button, and the handler called OnOK(), thus closing the dialog.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I've mailed you a sample.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks - yours works great (though its got nothing in the DEbug folder even though I built it! Thats something I've not seen before). ANyways - I sent you mine. It doesnt work! I even put in the return in my OnOK() that i didnt have. What do you think is the problem with my attempts?
aaaaargh!
|
|
|
|
|
nss wrote:
though its got nothing in the DEbug folder even though I built it! Thats something I've not seen before
WAH! MOMMMMMMMY!
There's something very wrong with your system! I suggest a reboot. Really. Are you pulling another all-nighter?
nss wrote:
What do you think is the problem with my attempts?
Did you get my email (not thru CP)?
Whatever happened to Avis? Has he disappeared off the face of the earth? A web search has yielded NULL.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I will reboot. But I have stuff in my Debug Folders....
Avis: faint glimmerings of memory. What is Bhaya doing do you know? (That was his name right?). gosh - ghosts from the past.
Actually going to sleep tonight. Didnt do too much but planned next design stages today. Did you get some food into you? I soon shall. Nothing exciting though. Hey thanks for the zillions of emails and sample and all the help. No one could have predicted it was my tab order that was the culprit! All this time i've been doing pretranslate with bated breath...
Adios! I'll treboot now and go scout out the kitchen...
|
|
|
|
|
nss wrote:
What is Bhaya doing
I haven't a clue - I lost touch with him when I left.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have created a class now and want to test it. But the compiler says:
fatal error C1010: unexpected end of file while looking for precompiled header directive
In the .cpp file for my class I have in the beginning of the file
#include "MyHeaderFile.h"
and what can be wrong!?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Typically in MFC Apps you have a "stdafx.h" header file which is used as the precompiled header. Then in Project|Settings |C/C++ |Precompiled Headers you set "Use precompiled header file (.pch)" - "Through header: stdafx"
If you aren't using precompiled headers then set "Not using precompiled headers" instead.
See the VC++ Help for info on precompiled headers.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I will try that out!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
|
How exactly did you create a class? A safe way of doing that is to create a simple AppWizard project and use Class Wizard to create a generic class. Thus Class Wizard will generate the headers so that you'll only need to add your code.
|
|
|
|
|
Well I opened Notepad and wrote it by my own!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
VC++ adds some headers all by itself so you may have forgotten to include some file (this has already been said before). So just open VC++ and add a class with Class Wizard.
|
|
|
|
|
By mistake somehow my project has two classes in it by the same name. its very confusing. How can I delete both and start over? This is a class associated with a CDialog form and it was created via the classwizard.
Thanks,
ns
|
|
|
|
|
delete the files from the workspace, then delete the actual files.
then delete the .CLW file.
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
I'll do that.
|
|
|
|
|
|
I've noticed several times that the 'Auto Complete' function in my VC++ Editor doesn't work in certain parts of the code. Despite numerous attempts I haven't noticed any logic its behaviour: sometimes it works, sometimes not. Has anyone ever had such a problem or is it a bug of my version?
|
|
|
|
|
it's a bug in VC6. you might want to check out Visual Assist (http://www.wholetomato.com)
-c
Conservative:
One who admires radicals centuries after they're dead.
-- Leo C. Rosten
|
|
|
|
|
VC6 IntelliSense is very picky. If you have any syntax errors, it will prevent IS from working at any point below the error.
If you have no errors, close the workspace and delete the .NCB file. That often fixes things.
--Mike--
Just released - RightClick-Encrypt v1.3 - Adds fast & easy file encryption to Explorer
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|