|
void ReadAnalog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
int value;
value = 1;
for(;;)
{
SetDlgItemInt( IDC_READ_ANALOG_01, value );
}
}
at some point i will add code to read in from a meter and store a number into 'value' but until then, i just set it = 1.
I don't exactly get an error when i open the dialog window, however, the window does not open and i get the (Not Responding) thing in the title bar of my program. My assumption is that this for loop executes forever, and the page will not get created until it is finished. (I just made the loop go from 0-20, and the program worked fine.)
Is there some other place i can update the value of the static text after it has been displayed?
*.*
cin >> knowledge;
|
|
|
|
|
keegan wrote:
My assumption is that this for loop executes forever, and the page will not get created until it is finished.
That's correct. An application is considered to be responding if it checks its message queue. You are not checking the message queue, and therefore cannot do anything (including updating the screen), and therefore the program is not responding.
The method I would use is to set a timer (for 10ms or something like that), and update the value whenever the timer message handler gets called.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
ok, suppose i use Sleep(10) to wait 10 miliseconds, then display the data. This provides a problem, being that it still only updates once. You said to update whenever the timer message gets called, well, if i put this in my ddx, it will only get called once, when the page is created, correct? Is there someplace else i can add the data, after the page has been created?
I guess is what i'm asking is how do i put a an infinite for loop in a dialog box.
*.*
cin >> knowledge;
|
|
|
|
|
keegan wrote:
I guess is what i'm asking is how do i put a an infinite for loop in a dialog box.
I hope not. That's a bad bad idea
What I meant was to use SetTimer() to start a timer that posts a WM_TIMER message to your message queue every 10ms or so. You then handle the WM_TIMER message, and whenever the message is received, update your dialog - don't use an infinite loop. In your WM_TIMER handler (OnTimer() ), call SetDlgItemInt() to set the new value. It's not necessary to use DoDataExchange() at all.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
works like a dream
you da man
*.*
cin >> knowledge;
|
|
|
|
|
Does anyone use the undocumented PushMessage Commnad anymore? This was my solution to this problem. I geuss it is undocumented for a reason in that if you use it improproperily it can cause strange slow down and crashes, but it seems more elegent to me.
|
|
|
|
|
JWood wrote:
PushMessage
I've never seen that function. And if I had, I probably wouldn't use it because it's undocumented, which basically means it could change or be removed at any time . I generally stick to the documented functions if possible.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Answer to first question.
You need to convert your int to a string;
INT MyInt = 5;
CString MyString;
MyString.Format("%d", MyInt);
SetDlgItemText(STATIC_ID, MyString);
|
|
|
|
|
All is in the subject !
I would like to change the header which is sent to server by the webbrowser control from Microsoft, but how to do that ?
Any clues ?
Thanks.
|
|
|
|
|
How can I hide process from task list in Windows NT/XP?
|
|
|
|
|
I don't think that can be done.
But you can use rundll32 to execute your dll and it will show up in the process list as rundll32...
John
|
|
|
|
|
Why do you want to do this?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I agree. Maybe he is writing a virus or one of those internet spy programs... Or maybe he does not want users to stop his program using the task manager...
John
|
|
|
|
|
Hi,
this is Rare task! Are you want to write virus?
I hope NOT.
You can study technical side of this question
on the following links:
http://win32assembly.online.fr/files/hidden.zip
or
http://www.sysinternals.com
or hmmm ...
just put search string similar: " "hide process" and C++ and source " to the yahoo and read retrieved links.
|
|
|
|
|
Thanks for your suggestions!
I am writing a program for internet cafe where i have a server and a client program. I don't want that my client program to be terminated by customers so that the server will always have control to its client pcs.
Have already done this in Windows 9x using RegisterServiceProcess() but not in Windows NT/XP. Some suggests that i should run my program as service but i don't know how to do it(how to run my program as a service in NT using MFC).
|
|
|
|
|
|
How to get the file name while doing saving process internally in vc++
|
|
|
|
|
If the program is in the process of saving, isn't a file name already known? Perhaps you could elaborate a bit more as I've probably misunderstood your question.
|
|
|
|
|
I have a problem...
I have 0 erros,0 warnings
so , the project is uptodate
but, every time i press F7 , my Visual Studio.Net builds the project
anyone knows that this is ??
MSN:maxsnts@hotmail.com
|
|
|
|
|
Is the date/time set correctly on the computer? After a successful build, are any of the CPP/H/RC files newer than their OBJ/RES counterparts?
|
|
|
|
|
not all my projects have this problem (only the important one )
I have deleted the debug and release folder, rebuild all soluction
and it does the same
I have not made any change to any of the project files since it started to have this problem
its a large project and its impossible to work like this
MSN:maxsnts@hotmail.com
|
|
|
|
|
Hi,
If wou want solve this problem (And to not search for its reasons)
do:
1) Close IDE
2) Check system date/time on your computer
3) Set up "current" date/time to all project files.
4) Launch IDE and do Rebuil All.
Vitali
|
|
|
|
|
I have found the problem.
I have recently installed a windows 2003 server as a domain controler,
and the problem is that all the machines connected to this domain verify the date\time of the server every f**ing minute and set change their date to match the server.
the domain server had a bad date.
so every time i changed the time on my machine, the pc changed the time back to match the server.
the windows 2000 server dosent do this, so , i didint think that was the problem
MSN:maxsnts@hotmail.com
|
|
|
|
|
Where can I find a good tutorial about automating Outlook in C++ (no MFC)?
I need to know how to handle the calendar.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
How about MSDN for starters?
|
|
|
|