|
I renamed IDOK to ID_BEXIT , and did this:
void CWinViewerDlg::OnOK()
{
}
void CWinViewerDlg::OnBexit()
{
CDialog::OnOK();
}
and changed the tab order so that the exit button is not #1. yet I hit enter and the dialog vanishes. I recall but not quite something along these lines that will stop this. I dont want to use PreTranslateMessage.
Ideas?
Thanks,
ns
|
|
|
|
|
Make sure ID_BEXIT is no longer the "default" button (uncheck that attribute in the resource editor).
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
that was it.
How are you? Been ages since I heard from you........
Thanks,
ns
|
|
|
|
|
Pretty good, given that I've been working 100 hr weeks for 6 months. But on the bright side, our new app is rock solid and slick (imho). We release next week, after which I may go hog wild and take an entire weekend off.
Our little company's been doing pretty well, too. You can check us out here[^].
Hope all's well with ya! How did the 1st year of college go? Seems like only yesterday, no?
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Well, re college, our guy decides he doesnt care for science and math, so he is going to do languages at the defense languages institute in CA. ..... he joined the navy !!!!!! Probably something asian or middle eastern.
Been doing a bit of QT..
|
|
|
|
|
very easy.
from ur new dialog box (OK and cancel buttons on it), double click OK button to add the function and keep it do nothing, then delete the button from dialog.
the enter key is disabled for the message.
if u delete OK button, create a new dialog then copy the button to original dialog box.
includeh10
|
|
|
|
|
What happens if thread is Slept() and WM_MESSAGE received?
the old place of execution is lost?
if message processing occurs in that thread?
Or thread execution continues, and than only message is proceed?
thanks.
|
|
|
|
|
If you call Sleep , the thread is blocked. No messages will be processed until Sleep returns, once the duration has timed out. Execution will resume - on that thread - with the statement after Sleep (just like any other function call).
Message processing only occurs inside GetMessage , PeekMessage , or one of their siblings. If the thread is busy doing something, the messages queue up. If the message was sent from another thread (using SendMessage or one of its siblings), the message is processed entirely inside GetMessage . Otherwise, GetMessage returns the message in a MSG structure; it's up to the application to process it how it chooses. Typically that involves DispatchMessage to pass the message on to the window procedure for the window.
If you use SendMessage to send a message to a window on the same thread, SendMessage calls the window's window procedure directly.
The only way I've found to block for a period of time and still process window messages is to use the MsgWaitForMultipleObjects family of functions.
|
|
|
|
|
I apologise in advance, but:
The stl documentation in the MSDN *sucks*, big time. Half the time, I can't find what I want to know, and the other half is confusing as hell.
I can't help wondering that I could have been a pretty good stl programmer by now if it wasn't for the crap stl documentation that I have to read tolerate everyday.
I have the Jan 2001 MSDN library and I can't stand using this as a stl reference anymore.
I've come to rely on and love the MFC documentation over the last few years; its a shame the stl section is not as friendly.
Are there any good reference material out there for the stl, from beginners to advanced level? Online, Paperback, or the latest MSDN library maybe (not using .NET yet though!)
Any suggestions welcomed.
Rich. (p*ssed off big time! )
I Dream of Absolute Zero
|
|
|
|
|
As a reference I use this[^]one.
But it is certainly not a beginners tutorial.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Thanks for that.
I'm sure i'll come in handy in times of crisis.
I Dream of Absolute Zero
|
|
|
|
|
I really like "STL Programming from the Ground UP" by Herbert Schildt.. I find myself looking up stuff daily...
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Is this book more like a turorial for absolute beginners?
I would probably need something more along the lines of a reference with excessive explanations.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
IMHO I would say it's probably geared more to beginners. It assumes no prior knowledge of STL but I still found that it covered everything I have ever needed.
You would probably want to stop by a bookstore and look through the book before you bought it. You might find it too simple, then again it may cover the stuff your looking for.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
|
Cool. I was thinking of getting myself another stl book.
This one looks right up my street.
I Dream of Absolute Zero
|
|
|
|
|
Theres a file I want to rewrite on the fly. If I write into it data less than the original number of lines, using writeString CFileStdio, then the remaining text from the original is stil there following my new lines. I dont want to kill the whole file and recreate it...I want it to always exist, but how do I go and empty out the file so the new data has a fresh clean slate?
Thanks,
ns
|
|
|
|
|
Open the file with the CFile::modeCreate flag set. This will create the file if it does not exist, or clear the existing contents if it does.
You can then use CFile::modeNoTruncate with the above, if you want to preserve the contents.
I Dream of Absolute Zero
|
|
|
|
|
I am trying for several days to stream RTF text which contains OLE objects (bitmaps) into a CRichEditCtrl. StreamOut works absolutly perfect. If I save the streamed out string to a file, I see the objects if I open the file with wordpad. But if I try to stream the string back into an other control, I only get the plain RTF formatted text and the OLE objects are missing!
So, is it not possible to stream in OLE objects into a RTF control?
What need to be done if I want to stream RTF text incl. OLE objects into a CRichEditCtrl?
Thanks in advance.
|
|
|
|
|
Well, it seems the other control isn't handling the ole objects (like, duh!). Look into GetIRichEditOle and SetOLECallback. I haven't tried implementing them myself, but they look to be the key things to get this to work.
Joel Lucsy
|
|
|
|
|
Thanks for you answer.
I also found that OLE stuff, but I am not sure what I should do with it. The M$ "documentation" of the OLE interface of CRichEditCtrl is practically nothing.
I also think, that somewhere in the CRichEditVIEW and CRichEditDOC classes something similar must be done in order to load RTF text with OLE objects. But unfortunately I can't use CRichEditView.
I hope someone can give me a hint about it.
|
|
|
|
|
I think this comment in Codeguru can be the solution of the problem:
http://www.codeguru.com/mfc/comments/27104.shtml
We must implement the IRichEditOleCallback interface. The most important method seems to be GetNewStorage!
You can find the full code if you follow the link above!
|
|
|
|
|
Hi all,
I need to bringup a scale control in inches upon my Edit Control, (as in the top of the Word Document )
Any Components are avilable??
Thanks in advance
Warm Regards,
KKR
|
|
|
|
|
after editing code:
void CDlgDelete::OnOK()
{ CString deleteID;
deleteID.Format("ID = %s", m_str_deleteID);
recordset.Find(AFX_DAO_FIRST, deleteID);
recordset.Delete();
recordset.Update();
recordset.Close();
database.Close();
CDialog::OnOK();
}
i run program and encountered messagebox error: syntax error(missing operator) in expression. how to correct it?
|
|
|
|
|
Have you used the debugger (or popped up a message box) to check and see what exactly the value of deleteID is after formatting it? There might be a quote missing somewhere.
|
|
|
|