Problem with Sleep() function in Thread Proc
-
Hi all, I am writing one win32 Application using VC++.NET 2003. I am getting one wired error in my thread proc. I am creating one thread using
CreateThread()
function.this->m_threadHwnd = CreateThread(NULL, 0, ThreadFunc, this, 0, NULL);
But when I am using
Sleep()
function in thisThreadFunc()
it gives me error like“There is no source code available for the current location”
. Sleep() function is working fine with other methods but not with ThreadFunc(). Can I know hoe can I solve this problem? Thanks in advance, Priyank -
Hi all, I am writing one win32 Application using VC++.NET 2003. I am getting one wired error in my thread proc. I am creating one thread using
CreateThread()
function.this->m_threadHwnd = CreateThread(NULL, 0, ThreadFunc, this, 0, NULL);
But when I am using
Sleep()
function in thisThreadFunc()
it gives me error like“There is no source code available for the current location”
. Sleep() function is working fine with other methods but not with ThreadFunc(). Can I know hoe can I solve this problem? Thanks in advance, Priyankpriyank_ldce wrote:
“There is no source code available for the current location”.
Possibly, you are trying to step in to
Sleep
API while debugging, isn't it ?Prasad Notifier using ATL | Operator new[],delete[][^]
-
Hi all, I am writing one win32 Application using VC++.NET 2003. I am getting one wired error in my thread proc. I am creating one thread using
CreateThread()
function.this->m_threadHwnd = CreateThread(NULL, 0, ThreadFunc, this, 0, NULL);
But when I am using
Sleep()
function in thisThreadFunc()
it gives me error like“There is no source code available for the current location”
. Sleep() function is working fine with other methods but not with ThreadFunc(). Can I know hoe can I solve this problem? Thanks in advance, PriyankPerhaps a little bit off topic, but it may solve your problem anyway... The call to
::Sleep()
should probably be removed. When mentioning a sleep operation together with multithreading, chances are that the multithreading concept is not quite understood. Even the use of::Sleep()
is a warning sign itself. Read about why::Sleep()
should be avoided here[^]. Read about how multithreading should be done here[^]. I humbly advise you to read the articles since they will prevent you from doing common mistakes that you will have a hard time tracking down later.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
Perhaps a little bit off topic, but it may solve your problem anyway... The call to
::Sleep()
should probably be removed. When mentioning a sleep operation together with multithreading, chances are that the multithreading concept is not quite understood. Even the use of::Sleep()
is a warning sign itself. Read about why::Sleep()
should be avoided here[^]. Read about how multithreading should be done here[^]. I humbly advise you to read the articles since they will prevent you from doing common mistakes that you will have a hard time tracking down later.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknownExcellent source material – I’ll try to remember it. (You are forgive! for the VB phase)
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
-
Excellent source material – I’ll try to remember it. (You are forgive! for the VB phase)
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
John R. Shaw wrote:
Excellent source material
Yep, Joe's entire site is quite a gold mine in my opinion.
John R. Shaw wrote:
You are forgive! for the VB phase
Thanks John, it took me a little while to understand what you meant though. I didn't expect anyone to actually read the bio.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
John R. Shaw wrote:
Excellent source material
Yep, Joe's entire site is quite a gold mine in my opinion.
John R. Shaw wrote:
You are forgive! for the VB phase
Thanks John, it took me a little while to understand what you meant though. I didn't expect anyone to actually read the bio.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknownRoger Stoltz wrote:
Yep, Joe's entire site is quite a gold mine in my opinion.
My best source of that kind of information is CP; meaning you and others on the boards.
Roger Stoltz wrote:
Thanks John, it took me a little while to understand what you meant though. I didn't expect anyone to actually read the bio.
VB was ok and VB.Net is much better, and we can use that. They are programmers, but it is what they do not know that bothers me.
INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra