|
While using Sleep(0), I've noticed lag when the process context is switched to the next application. It seems almost as if Sleep(0) is causing the processor to thrash between apps. Maybe I'm just . I was wondering if any of you have noticed something similar? Also, other than thread priority is there a way to relinquish thread control?
Just as an afterthought. For a while I ran the United Devices Cure for Cancer app. I noticed that it kept the CPU pegged but I was never able to tell when the process context switched. I wonder what they used.
nay
|
|
|
|
|
Why are you using Sleep(0)? Why do you feel the need to stall the thread?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Other applications are running concurrently. I do not want one to "hog" resources. From the MSDN Sleep(0) is what I want, but I'm not satisfied with the performance of it. I was just curious if there was another solution.
nay
|
|
|
|
|
If you have one thread that just wants to peg CPU,
use Sleep(50); ... Sleep(200);
|
|
|
|
|
Windows is a preemptive multi-tasker. It will periodically suspend your process to allow other things to run. If that isn't good enough for the thread in question, then force the priority of the thread to a lower level. Thus, if the use tries to work with practically any other window, they will be responsive.
There just isn't any justification for using Sleep on a real multi-tasking operating system. It causes excessive kernel transitions to do something that the OS is already designed to do for you.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Does anyone know if there is a limit in VC as to the number of controls you may place on a dialog? I know it sounds like a bizare dialog, but I have 255 controls on it, and am unable to place anymore. When I select a control from the palette and try to draw it on the dialog nothing happens. If I copy a control from the dialog and attempt to paste it, the paste button will not become active. I'm sure you're wondering why one would have so many controls on a dialog, it has 200 check boxes which display a status of a device and labels for groups of the check boxes. I need to have 25 more check boxes.
Does anyone know if 255 is the limit for the number of controls one can place on a dialog? I've exited and come back into VC, thinking maybe that would work, but no luck.
Any suggestions would be appreciated.
Thanks in advance,
Bob
|
|
|
|
|
I do not know, but it is easy to find out. Open your .rc file in notepad and add controls manually.
|
|
|
|
|
I believe the limit is in the GUI portion of the tool. It does appear to be limited to 255 controls. If I remove 3 controls, I can add only 3 more. I can however, add controls by manually editing the .rc and resource.h files.
Thanks for your input,
Bob
|
|
|
|
|
i wonder ! isn`t this because you have run out of space on it ?
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
Hello,
I am a shareware author that some people localize to different localization. I use the resource DLL option and needed an easy tool for my translators to produce a localized DLL. Smart Translator (available in Free Tools on CP) was almost what I wanted. One problem: it was written using BCG.
So I took the source code, ported the interface to MFC, ported some of the features (not all) and added many more. Finally the tool is working kind of correctly. But there are still bugs to fix!
My problem is that my real shareware takes me a lot of time so I have not much time to spend on this updated Smart Translator. So I am looking for someone who is willing to take over the task to provide a great free localization tool to the community. I already contacted the author of Smart Translator and he has no problem that the someone takes the code and makes it evolve so you do not have to worry about that...
So if you fell like seriously taking this task over and keeping the stuff free then reply in this thread or contact me by mail: info@nabocorp.com.
Regards,
nabocorp
http://www.nabocorp.com
|
|
|
|
|
try www.gnu.org. Most of people here work for living.
|
|
|
|
|
And so? I also work for a software company and code my freeware/shareware on a small part of my free time. I guess a lot of people do the same...
|
|
|
|
|
I want to read a file which in a NT server. the file path is \\nt\myfile\mydata.txt
I write these:
CFile aa.Open("\\\\nt\\myfile\\mydata.txt",CFiel::Read);
but this always be wrong!
I can't open the file mydata.txt from the nt. I have the account and password.
What is wrong with this? Please help me! Thank a lot!
|
|
|
|
|
Do you have to login to open that file?
|
|
|
|
|
UNC paths are comprised as \\servername\\sharename\directory\directory\filename
So, it looks like you forgot the include the sharename of the drive you need to access. For instance, I've shared my C: drive as C, so I'd do something like \\joel\c\windows\notepad.exe
Joel Lucsy
|
|
|
|
|
This is what I need but have no idea where to start. please help I am a real newbie to this stuff.
Create a base class-of type Tree that
you can plant, (think construct)
you can grow by age. 1,2,3 etc.
Create a derived class-Fruit-that will allow me to
grow 2 apples on my tree when age 2
grow 2 oranges on my tree when age 3
pick my fruit
design client code that will let the client plant, a tree and input ages to the tree-age begins at zero and apple and orange count is zero.
When age(input by client)is two, have two apples that clieck pick(apple count goes from two to zero)
When age(input by client)is three, have two oranges that clint picks(organge count goes from two to zero)
files should be
tree.cpp (base class)
tree.h
fruit.cpp(derived class)
fruit.h
farmer.cpp(client code)
I have to be able to run the code, test the code, print the code no file IO, just keyboard IO.
Need this really bad..........have no Idea please help!!
Alan A. Decker
|
|
|
|
|
Homework, by any chance?
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Is there any sample C program implementing Progress Bar using WinAPI but without using class?
Thanks for kind help.
wave
coolcool883@hotmail.com
|
|
|
|
|
Firstly, you just add a progress bar control into your dialog resource, then using
LRESULT SendMessage(<br />
HWND hWnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
you can set all the parameters of the control after getting its handle using GetDlgItem() .
For e.g.
<br />
HWND hProg = GetDlgItem(hDlg, IDC_MYPROGBAR);<br />
SendMessage(hProg, PBM_SETRANGE32, 0, 100);
will set the range of the control from 0 to 100. For all messages, this is the link to progress bar control messages in the MSDN
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/progbar/reflist.asp?frame=true
|
|
|
|
|
Hello everybody,
This might sound like a stupid question, but I can't find anything. Do you guys know how I can compile a Visual C++ application in the command-line? Is there any place on the web where I can find information about that? Any answer is more than welcome.
Best regards,
Luis E. Cuadrado
)
|
|
|
|
|
Check the .plg file in your project's directory.
rechi
|
|
|
|
|
Having Visual C++ dsp file you can build it by such way:
msdev MyProject.dsp /MAKE "MyProject - Win32 Debug"
Replace MyProject with your project name. Change Debug to Release if necessary. Try to play with parameters, I think adding parameter ALL makes Rebuild All.
|
|
|
|
|
Hello,
Just what I need. I tried and it works.
Thank you very much for you help.
Best regards,
Luis E. Cuadrado
)
|
|
|
|
|
How can u do this in .NET enterprise developer edition??
|
|
|
|
|
If I try and create a a CInternetSession object I need to specify my proxy name. When I then call GetHttpConnection() on the session object, I have to specify a username and password to authenticate with my proxy server. Unfortunately, my proxy server also requires a domain name. Anyone know how to do this?
I did think the following format would work but it doesn't:
username = mydomain\myusername
password = mypassword
"The folly of man is that he dreams of what he can never achieve rather than dream of what he can."
"If you think education is expensive, try ignorance."
|
|
|
|