|
This is clearly a homework request. Nobody would write a new app in the 21st century that requires the Enter key to be pressed to step through a list of entries.
|
|
|
|
|
A hint for posting code on CP forums.
this method preserves all the < and > brackets, and all the code in between them.
1.) In VC IDE highlight the code you wish to post.
2.) copy the code to the clipboard (menu : Edit | Copy, Keyboard Ctrl + c)
3.) start Microsoft FrontPage Express
4.) in MS FPX, paste your code (menu : Edit | Paste, keyboard Ctrl + v)
5.) edit your message in MS FPX
6.) select menu item View | HTML, a window will popup containing the HTML text of your message.
7.) highlight all the text between the lines <body bgcolor="FFFFFF"> and </body>. Do not include these lines. This is your message.
8.) press ctrl + c (copy to the clipboard)
9.) in Code Project's submission edit box, press ctrl + v
now your submitted code will contain all the < and > brackets. it just makes it a lot easier for others to now what your actual code is, what header files are included, ect.
and please use the Preview button to make sure the code you submit is the code you want to submit.
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
I have a small problem , Please help me !!!
This is my code:
-----------------------------------------
void CTestDlg::OnOK()
{
// TODO: Add extra validation here
m_edit1 = "22222222222"; //CString תיבת טקסט מסוג
UpdateData(false);
Sleep(3000);
m_edit1 = "1111111111";
UpdateData(false);
//CDialog::OnOK();
}
--------------------------------------
Why the first message ("222222222") dont apear in the edit box when this program runs ???
miri
|
|
|
|
|
Because your program's thread is suspended in the Sleep() call. Windows don't just magically repaint, your thread and message pump have to be running.
--Mike--
http://home.inreach.com/mdunn/
Tables, ladders, chairs, OH MY!
|
|
|
|
|
I have a small problem , Please help me !!!
This is my code:
-----------------------------------------
void CTestDlg::OnOK()
{
// TODO: Add extra validation here
m_edit1 = "22222222222"; //CString תיבת טקסט מסוג
UpdateData(false);
Sleep(3000);
m_edit1 = "1111111111";
UpdateData(false);
//CDialog::OnOK();
}
--------------------------------------
Why the first message ("222222222") dont apear in the edit box when this program runs ???
miri
|
|
|
|
|
Sleep doesn't allow Windows messages to get through. You need to use something like a timer or a message pump function.
-c
------------------------------
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
Thank you very much on your answer.
Can you show me example how to use in timer ???
miri
|
|
|
|
|
You are going to need to capture the WM_TIMER message, in this function you perform whatever actions you require to happen at a set interval. The message is started by a call to SetTimer and finished with a call to KillTimer.
SetTimer(1, 100, NULL);
KillTimer(1);
void CMyDlg::OnTimer(UINT nIDEvent)
{
CDialog::OnTimer(nIDEvent);
}
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Thank you very much But I dont success.
I need only one waiting of a few minutes between the first two lines:
//////////////////
m_edit1 = "22222222222"; //CString תיבת טקסט מסוג
UpdateData(false);
///////////////////
to the last two lines:
//////////////
m_edit1 = "1111111111";
UpdateData(false);
///////////
Can you shoe me exactly how to do it ???????
/////////////////////// thanks
miri
|
|
|
|
|
CEdit* pText = (CEdit*)GetDlgItem(IDC_TEXT);
pText->SetWindowText("22222222222");
pText->UpdateWindow();
UpdateData(FALSE);
Sleep(3000);
pText->SetWindowText("111111111111111111111111111");
pText->UpdateWindow();
UpdateData(FALSE);
Sleep(10000);
Carlos A. Antollini
|
|
|
|
|
Thank you !
This is wonderful !
But there ara one big problem
that after Sleep(10000)
the first text recived.
I want that the second text will remain
What can I do ???
thanks
miri
|
|
|
|
|
excuse me !
I found the problem.
that appened because I did not update the text box variable
that I intialized before .
Thank you very much on your answers !
miri
|
|
|
|
|
How can I to change a static picture(bitmap) from disible to visible and from visible to disible in the code(wich metod?) ???
Please help me !!!!!
miri
|
|
|
|
|
You just call the ShowWindow method of the corresponding CWnd, with parameter SW_SHOW or SW_HIDE.
The CWnd* can be retrieved by GetDlgItem(ID) or you subclass the ctrl with the classwizard.
Pseudocode is code to demonstrate a concept, not designed to be run.
Like certain Microsoft software.
|
|
|
|
|
thank you!
Can you show me example ?
I need to show a picture that defined as CStatic(bitmap)
and after a few minutes to hide it .
How doing it ???
miri
|
|
|
|
|
Here is my code...
CPen pen, pen1, pen2;
pen.CreatePen(PS_SOLID, 2, WHITE);
CDCPointer->SelectObject(&pen);
..*
..*
..*
pen1.CreatePen(PS_SOLID, 2, BLACK);
CDCPointer->SelectObject(&pen1);
..*
..*
..*
pen2.CreatePen(PS_SOLID, 2, RED);
CDCPointer->SelectObject(&pen2);
..*
..*
..*
When i compile it....there is an error message on the line of pen1.CreatePen..
"error C2668: 'CreatePen' :ambiguous call to overloaded functinn"
What is it?
|
|
|
|
|
It doesn't recognize the constants WHITE, BLACK, and RED.
|
|
|
|
|
I am having trouble getting a bitmap to display on a dialog. I've set the Picture Control in the window (Dialog) and set the Type property to Bitmap. I can get it to display a resource bitmap created in the editor and assigned to the control via the Image property. What I would like to do is have a dynamically drawn bmp displayed and updated as needed on this dialog. I know how to draw the bitmap just not how to get it thrown in to the Picture Control.
Thank you for your time
lp
|
|
|
|
|
there's a control called CBitmapCtrl over at www.codeguru.com
see how he did it
|
|
|
|
|
Thank you, I'll take a look.
lp
|
|
|
|
|
This should be easy, I've created a new VC++ 6 dialog based app with a single rich edit
control (and the standard OK/Cancel buttons).
I've added AfxInitRichEdit() to InitInstance() and a NM_SETFOCUS message handler using the Class Wizard.
The NM_SETFOCUS handler never fires?
Any Ideas?
|
|
|
|
|
Don't rich edit controls just suck ? I mean, if I *have* one, why do I have to specify with a call that I want to *use* it ?
Anyhow, the fun is not over yet. You need to tell the rich edit to send you messages using the SetEventMask function with a combination of the following flags:
ENM_CHANGE Sends EN_CHANGE notifications.
ENM_CORRECTTEXT Sends EN_CORRECTTEXT notifications.
ENM_DRAGDROPDONE Sends EN_DRAGDROPDONE notifications.
ENM_DROPFILES Sends EN_DROPFILES notifications.
ENM_IMECHANGE Rich Edit 1.0 only: Sends EN_IMECHANGE notifications when the IME conversion status has changed. Only for Asian-language versions of the operating system.
ENM_KEYEVENTS Sends EN_MSGFILTER notifications for keyboard events.
ENM_LINK Rich Edit 2.0 and later: Sends EN_LINK notifications when the mouse pointer is over text that has the CFE_LINK and one of several mouse actions is performed.
ENM_MOUSEEVENTS Sends EN_MSGFILTER notifications for mouse events.
ENM_OBJECTPOSITIONS Sends EN_OBJECTPOSITIONS notifications.
ENM_PROTECTED Sends EN_PROTECTED notifications.
ENM_REQUESTRESIZE Sends EN_REQUESTRESIZE notifications.
ENM_SCROLL Sends EN_HSCROLL and EN_VSCROLL notifications.
ENM_SCROLLEVENTS Sends EN_MSGFILTER notifications for mouse wheel events.
ENM_SELCHANGE Sends EN_SELCHANGE notifications.
ENM_UPDATE Sends EN_UPDATE notifications.
Rich Edit 2.0 and later: this flag is ignored and the EN_UPDATE notifications are always sent. However, if Rich Edit 3.0 emulates Rich Edit 1.0, you must use this flag to send EN_UPDATE notifications..
Coz just because you initialized a CRichEditCtrl doesn't mean you want it to talk to you, right ? Sheesh...
Christian
I've learned that you cannot make someone love you. All you can do is stalk them and hope they panic and give in.
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Well that makes sense! - Do you think it was a Friday when they invented this?
Maybe there is an easier way to do this (as you can guess I'm a newbie!). I need to have a read-only rich edit control, it will be populated and has auto scroll but I do not want it to receive focus. Can you advide on the easiest to achieve this?
|
|
|
|
|
I don't think there is an *easier* way - the only two other options that occur to me are to use a class that wraps a font and draw it yourself ( I'd probably do this, but it's not *easy*, that is, the RichEdit is not harder ), or create an IE Window in my dialog and do it in HTML ( useful under some circumstances ).
I'd recommend sticking with the Rich Edit because you're largely out of the woods now, and my personal approach is to stick with a method until I've learned it, try something else the next time and then I can say that
a/ I can make an informed decision come the third time and
b/ the damn computer didn't beat me.
Christian
#include <std_disclaimer.h>
|
|
|
|
|
HELP! (PLEASE!)
OK, I admit defeat I cannot get this thing working!
The events are now firing after using SetEventMask() but how the heck
do I know that the control is about to receive focus (and therefore stop it!)?????
Any chance of a snippit of code?
|
|
|
|