|
YA GREAT , I WAS DOING MISTAKe TO ADD THIS VARIABEL (hWnd).Thanks you very much ,i got to fix the problem.
|
|
|
|
|
Hi all,
Im working in vc6.0 using MFC.
When I create thread using AfxBeginThread(), if the thread is running then the CPU utilization shown is around 50%,
even though the thread is doing nothing.
It is called as:
AfxBeginThread(PortReadThread,gpSerialPortCtrl,THREAD_PRIORITY_NORMAL);
If I create the same thread using CreateThread(),even the thread is running the CPU utilization is around 0%
It is called as:
CreateThread( NULL,0,(LPTHREAD_START_ROUTINE) PortReadThread,(LPVOID) this,0,NULL);
Is this the expected behaviour.If not please tell me why its behaving like that.
Thanks in advance.
Regards,
Sunil Kumar
|
|
|
|
|
Actually the AfxBeginThread() also calls the CreateThread() function internally to create a thread. so basically there should not be any difference in CPU utitlization. Some additional tasks AfxBeginThread() perform is the initialization of MFC and CRT global variables and thread specific variables. Also try the _beginthread().
sunilkumar.d wrote: even though the thread is doing nothing.
Nothing means? is it in some wait state?
|
|
|
|
|
Not in wait state exactly.just to test the application i have put a while loop
with empty braces in the thread.
Regards,
Sunil Kumar
|
|
|
|
|
Well thread is not doing nothing. The thread is busy executing infinite loop!!!
-Saurabh
|
|
|
|
|
sunilkumar.d wrote: Not in wait state exactly.just to test the application i have put a while loop
Ho .
Then the thread will definitly use cpu and the AfBeginThread() is working properly. I guess there is something wrong in calling Createthread() not in AfBeginThread().
|
|
|
|
|
Naveen wrote: Actually the AfxBeginThread() also calls the CreateThread() function internally to create a thread.
Nope, that's wrong. AfxBeginThread calls _beginthreadex internally.
There are some really weird people on this planet - MIM.
|
|
|
|
|
I am trying to further my knowledge of Object Oriented Programming, and I have acknowledged that my main weakness in this area is the figuring out what objects I need, and how they should be designed.About the projects,what i have done,are all
three-layer.I am tired of it.
I want to fill this gap in my knowledge so I am looking for any suggestions from people who're familiar with OOD and have any recommendations.recommending book is very welcome!
Thanks in advance.
|
|
|
|
|
Hello!
I wood like a program for: "Simulation of a GSM network for communications mobile" - where computers substitute mobile devices.
This program should be writen in c language.
|
|
|
|
|
Well...Good luck!
BTW: this looks like homework and you should know we usually don't do homework. Try to solve your problem and ask specific questions when you find obstacles along your path.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
So funny.
Where is the question?
|
|
|
|
|
wood like a program???? dont get what you mean... i did something like that, but that is using java...
|
|
|
|
|
Hi All
how can i show message on Mouse right click event?Currently i am useing this code
CADlg::OnRButtonDown(UINT nFlags,CPoint point)
{
Afxmessage("Right Click");
..............
}
This message is showing only click on Application.But i want to show click any where in system.
Plz help me
|
|
|
|
|
Try calling SetCapture in OnInitDialog .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for reply
Can you give some example link?
|
|
|
|
|
Davitor wrote: Can you give some example link?
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
You may use a global mouse hook [^], for this.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Can any one give me example link of Mouse hooking? plz help me
|
|
|
|
|
See, for instance, this article [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for reply.
Now my problem is solved
|
|
|
|
|
HI Guys ,
Iam new to c++ i want to read my .Pst file mails and print all then in a note pad or in console can any body help me out.
|
|
|
|
|
doubt this will work, try using getPathName() method and ShellExecute or Execute()
|
|
|
|
|
Easier said than done, especially if you're new to C++.
The way I'd normally suggest would be to use MAPI - this page[^] has some useful example C++ code, including loading a PST file.
This Codeproject article[^] also has code to extract data out of a PST file - it's written in VB.Net, rather than C++, though.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hey guys, I have created a button, called start Camera... Upon clicking the button, the computer will open the webcam(in a new window)...
Do any of u have an idea how do I do that? i know how to open using opencv, however, this is for my project, and my supervisor wants only Visual C++ for the time being, till cascade(which u probably dunno what is it) is completed... and I have to use Visual C++ to open the webcam instead of openCV... got any idea guys??? please help... thanks...
your help will be totally appreciated...
Edit/Delete Message
|
|
|
|
|