|
What you can do is set the text of your static control whenever something changes in the EditBox. Here how to do that:
1) Go to class wizzard and add a handler function for the 'change text' message (I don't remember which message exactly.
2) In this handler function Retrieve the text of your EditBox (GetWindowText) and calculate his length (with strlen).
3) Format this value in a new string (with sprintf) and set the text of the static control (SetWindowText)
|
|
|
|
|
cedric moonen wrote:
What you can do is set the text of your static control whenever something changes in the EditBox. Here how to do that:
Ohh I miss DeadLine
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Handle the EN_CHANGE message on Edit Box :- here is handller and IDC_EDIT1 is ID of Edit Box and IDC_STATIC_TEST is ID of the static box.
void CNegCtrlDlg::OnChangeEdit1()
{
CString str;
this->GetDlgItemText(IDC_EDIT1,str);
SetDlgItemInt(IDC_STATIC_TEXT,str.GetLength());
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I want to create a control like "timer control"
which in design veie won't change its size and in running mode invisible.
how can I proceed.
May be I am asking a silly quistion. But I am new to ActiveX control.
So please help me.
Regards
Anil
|
|
|
|
|
Hi All,
i am developing an applicarion in which a user can select any drawing entity and can translate it to any positin he wants..
I am using meta files for doing this..
i know how to translate it on the context..
but can anyone suggest me any method or procedure with which i can rotate it??
Can u suggest any link to page which illustrate this??
Ashwin
|
|
|
|
|
1. How can I create a Vxd(virtual device driver)?
2. Can you tell the steps in easy ways?
3. I heard that for creating a Vxd we must create certain
files with extension .sys.
4. Can i create a Vxd by simply specifying the EXE-Type
option of the linker as VxD?
5. Is the coding differs from normal VC++ coding?
|
|
|
|
|
Virtual device drivers only work in Windows 95, 98, and ME. You will need a copy of the Driver Development Kit (DDK) for Windows 95/98/ME, which may be difficult to find.
Software Zen: delete this;
|
|
|
|
|
Hi all..
I want to store Tree Information(CTreeCtrl), can any one help me out...
|
|
|
|
|
|
swarnamanoo wrote:
I want to store Tree Information(CTreeCtrl), can any one help me out...
Use STL::Map or Vector to store information if you required it at runtime only.. other wise you want to save it as file.. then XML format is best format for storing tree like information
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I want to make cut and paste operations on the CTreeCtrl...And i do not want to use clipboard instead wanted to store the tree information in a class...i want to use STL but iam not clear of how to go about..
|
|
|
|
|
Plz suggest a good tutorial on using Log/Semi Log Scales from VisualC point of view..
-- modified at 0:52 Friday 7th October, 2005
|
|
|
|
|
In VC 6, using the Class View to add functions and variables was quick and painless.
After moving the project to 2003 .net I mostly get
"An error has occured in the script on this page.
...
Error: 'arr_ControlTpyes' is null and not an object.
Code: 0
I have this after a clean install from the MSDN disks on multiple systems.
Has anybody run into this, how do I fix it?
Meanwhile, I use the manual method, but it's a step backwards...
-- Harald
|
|
|
|
|
I have a short question, and if the answer is no, then I have a much longer question I'll reply to this message with.
Can I only invalidate one rectangle specified by a couple CRect structures at a time? For instance, if a thread in a single timeslice had to run this code:
CWnd * pParent = ::AfxGetMainWnd();<br />
pParent->InvalidateRect(rect1, true);<br />
pParent->InvalidateRect(rect2, true);
where: rect1 and rect2 are pointers to valid CRect structures
I read in the help documentation, that that rectange is added to some list of regions to be updated so I think the answer is no but I can't find any information to definitively say yes or no, so hopefully some kind soul will ease my quarreling thoughts.
|
|
|
|
|
LighthouseJ wrote:
Can I only invalidate one rectangle specified by a couple CRect structures at a time?
yes I believe!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
See, I have code like this:
if (first test statement) {<br />
(update data)<br />
(invalidate one rectangle)<br />
}<br />
<br />
if (second test statement) {<br />
(update other data)<br />
(invalidate another rectangle)<br />
}
and both sections work independantly as far as what it tests for. The first if statement is run several times more than the second, but I let my program run and something I didn't expect to happens. What happens is that the screen is updated whenever the second statement is run (less often), but both the first and second rectangle are refreshed (with erases). I tried switching the order of the if statements but it still refreshes at the frequency of the lesser used if statement rectangle invalidation. I don't know what to do about it, right now at least.
|
|
|
|
|
I'm not sure I understood your problem, but keep in mind that invalidating just means that it will be updated in then next paint cycle. If you want to make sure the window gets updated after each 'invalidate' you should also call UpdateWindow right after calling InvalidateRect
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I tried that by doing something like this:
bool bUpdateWindow = false;<br />
CWnd * pParent = ::AfxGetMainWnd();<br />
<br />
if (first test) {<br />
(change data)<br />
pParent->InvalidateRect(pRect1, true);<br />
bUpdateWindow = true;<br />
}<br />
<br />
if (second test) {<br />
(change other data)<br />
pParent->InvalidateRect(pRect2, true);<br />
bUpdateWindow = true;<br />
}<br />
<br />
if (bUpdateWindow) { pParent->UpdateWindow(); }
But the behavior isn't changed from before.
|
|
|
|
|
Are you sure it's AfxGetMainWnd() the window you need to invalidate? What kind of window is the main one? Is it a dialog, MDI/SDI frame, or something else?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
hmm, well I'm invalidating and updating the window in a thread... you raise an interesting question. The main window, in the file mainfrm.cpp, is CMainFrame, derived from CFrameWnd. Am I calling it's routines instead of the child and that's what's not right?
|
|
|
|
|
I don't think invalidating CMainFrame would work, because it's unlikely CMainFrame is drawing something based on the data you change. You should be invalidating the specific window that needs to be updated. Better yet, if that's a CView-derived window, you should put the data in a document, modify the data using a document member function, which should call UpdateAllViews. Your view, in its OnUpdate member should invalidate and update itself based on that notification.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I'm trying to figure out a way to pass the instruction through from thread->CMainFrame(derived from CFrameWnd)->CChildView(derived from CWnd). There's no CView-derived thing in my project. I tried creating a message to pass but that's not working and I tried creating a function in CMainFrame to update the child view when it's called so the thread can call that, but it gives me access violations and it has question marks next to the values for the different window handles. I'm still checking it out.
|
|
|
|
|
If you are in a worker thread you can't make direct calls to CWnd objects created in the main (GUI) thread. Instead, you need to pass a window handle (HWND) to the thread function and use it there to send or post private messages (WM_USER + n) from the worker thread to that window.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
This thread is a user-interface thread, I overrode CWinThread and pass the runtime class name to AfxBeginThread just as the documentation say you're supposed to do for a user-interface thread. I was trying to figure out a way to use messages but maybe I don't know as much as I need to.
I defined a message like:
#define WM_UPDATECHILD (WM_APP + 1)
And tried to create a handler function for that message but it would never be run. I tried to override PreTranslateMessage, OnCmdMsg, and OnCommand to intercept this message, handle it, then return a nonzero result to show it was handled and none of this worked. I just don't know what to do.
|
|
|
|
|
When you invalidate a rectangle/region, this area does not get updated straight away. It will get updated the next time Windows decides to send your app a WM_PAINT message.
To force an update after you invalidate a region, call the UpdateWindow API
James
http://www.catch22.net
|
|
|
|