|
You might have problem accessing the dialog window (in MFC) from another thread, so you have to use the HWND to directly access the control , or post (userdefined) message to the dialog window from the thread which will update the information.
-Prakash
|
|
|
|
|
yeaa.. this is another useful tip. thanks prakash.
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
I agree with Mr. Prakash, this sounds like a clear case for sending messages.
take a look at this article. Message Management[^]
Using User-Interface Threads[^]
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
I'm trying to write a very time sensitive program so I need to make sure that the entire application receives the highest of priorities and that no background tasks are running. I tried using 'SetThreadPriority(hWnd,31);', but other tasks, processes, applications, etc still seem to run and interfere with the timing of my program. Is it possible to make my program such that it is the only task that is running on the computer? Thanks in advance for any help.
|
|
|
|
|
I think you could also try:
BOOL SetPriorityClass(HANDLE hProcess,DWORD dwPriorityClass);
But in my opinion, there is no way you could stop operating system processes from executing.
But boosting the priority to very high could easily hang the system...Oh I see that is exactly what you are trying to do, right?
this is this.
|
|
|
|
|
tonyro wrote: Is it possible to make my program such that it is the only task that is running on the computer?
I don't think so.there are many OS tasks that manage your system and you can not stop them , if you try to stop them (if you can!) the system may crash or go to an unstable condition.can you tell me the smallest unit of time you use in your program?
|
|
|
|
|
Thanks for your response. I'm trying to get all events in the program to be accurate down to the one millisecond scale.
|
|
|
|
|
Windows is NOT a real-time OS. So, the best you could hope for is around a 10-20 ms scale.
onwards and upwards...
|
|
|
|
|
Windows is not a real-time OS, It’s true! But there are techniques to satisfy timing constraints of a windows real-time application with 1 millisecond accuracy. Some of them may be complex and hard to implement but they are possible.
see this on MSDN: http://msdn.microsoft.com/library/en-us/dnxpembed/html/hardrealtime.asp[^]
-- modified at 0:47 Thursday 5th January, 2006
|
|
|
|
|
tonyro wrote: Is it possible to make my program such that it is the only task that is running on the computer?
Imagine if this were possible:
* How would the screen get drawn?
* How would the system read keyboard/mouse input?
* How would the system access the hard drive?
* How would the system manage the swap file?
Windows is the wrong OS for your task.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
This is why I continue to use Windows 98 on some systems and Exit to DOS, where I can control all of these functions. However, it is getting more and more difficult to maintain those machines. What modern OS would you recommend?
|
|
|
|
|
You can still run 98 on computers you can buy today. If 98 and DOS work for you, why change?
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Magnae clunes mihi placent, nec possum de hac re mentiri.
|
|
|
|
|
http://www.sysinternals.com/Information/TipsAndTrivia.html Look for "Never-ending Quantum?".
NOTE: I only add this for interests sake. The users of you program will not thank you for disabling multitasking on his machine. Basically here's how to do it but by the way, don't do it. I haven't actually tried it myself, just came across it in my travels.
Steve
|
|
|
|
|
Hi everyone
I have some problem with fread and fwrite in VS2005 beta2
I have the following code, in it i generate a buffer and after assigning some values to it , i write it to a file , then i try to read it back to a new buffer which is not successful.
for variable bigVal=100 i get "k=100" for writing but for reading i get "k=77" , i would be pleased if someone can help me.
#include "stdafx.h"
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
typedef double dtype;
int _tmain(int argc, _TCHAR* argv[])
{
dtype *b;
int i,j,k;
int bigVal;
char filename[]="c:\\temp.data";
FILE *fp;
bigVal=100;
b=(dtype*) malloc(bigVal * sizeof(dtype));
for(i=0 ; i
|
|
|
|
|
Hello.
I'm not sure if it's your only problem, but you should definately use binary mode for your files. So use:
fopen(filename,"wb")
and
fopen(filename,"rb")
Kakan
|
|
|
|
|
in fread and fwrite the first parameter is "void *" so try typecasting the first parameter as following
fread((void*)b,sizeof(dtype),bigVal,fp);
fwrite((void*)b,sizeof(dtype),bigVal,fp);
it worked when i tried past.
FAILURE is the first step towards SUCCESS
|
|
|
|
|
Hi
The CListCtrl click handler shows an edit box that allows to edit the subitem values. That is working fine when I click using the mouse.
But now, I need to simulate a click in a ClistCtrl, to open that edit box automatically.
I already tried using mouse_event but the mouse pointer appears in the task bar, and nothing else happens.
So, I think, I should call the CListCtrl click handler.
OnClick(NMHDR* pNMHDR, LRESULT* pResult)
The NMHDR* really is a NMITEMACTIVATE pointer.
So I filled the ptAction, iItem, and iSubitem and created a LRESULT variable.
Then I call OnClick((NMHDR*)struct, &lResult);
The handler is called, but the edit doesn't appear, and when I close the application it hangs up, and tell me if want to tell it to Bill Gates
Any suggestion really appreciated, and thanks for reading all that
Sebastian
|
|
|
|
|
You could send a direct message to the list ctrl, like:
m_List.SendMessage(WM_LBUTTONDOWN,0,MAKELPARAM(2,20));<br />
Sleep(100);<br />
m_List.SendMessage(WM_LBUTTONUP,0,MAKELPARAM(2,20));
However, the mouse-location (2,20) must be correct for it to work properly. Most probably you want an item to be selected also, which means that you have to calculate the item's correct location in the list ctrl.
An alternative would be to select an item in the list ctrl through code, and take its text and show the edit box yourself, without depending on the click-handler.
this is this.
|
|
|
|
|
you remember you helped me with the same code. i'm using this still. its cool!
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
I think I'm gonna doit the hard way, because I can't simulate the click.
The code you gave me doesn't work, altought it should.
To get the coordinates, I used a MessageBox in the click handler to show me the point, and I used those values, but Nothing :S
Thanks for the help man
|
|
|
|
|
Is IE Plugins ( like Acrobat Plugin for IE
or Flash Plugin/ Media Player etc) are ActiveX Controls or ActiveX documents;?
Is there any link for more information?
Happy New Year
|
|
|
|
|
IE Plugins are ActiveX Object.
I dont know anything called ActiveX documents.
-Prakash
|
|
|
|
|
Hi
You can get the links on google.
One thing i know is that you have to implemet the IHtmlDocument interface for it
Cheers
Ganesh
hi
|
|
|
|
|
ActiveX Documents are a little-used technology that appeared in the mid '90s to allow embedding other document types within an application. For example, when you click a link in IE that loads an excel or word document, Excel or Word runs inside the IE application.
onwards and upwards...
|
|
|
|
|
basementman wrote: ActiveX Documents are a little-used technology that appeared in the mid '90s to allow embedding other document types within an application. For example, when you click a link in IE that loads an excel or word document, Excel or Word runs inside the IE application.
Thank you.
-Prakash
|
|
|
|