allmer
asked on
How to set the Thread priority AfxBeginThread
Hi experts,
I ran into problems, using this:
DWORD priority = TranslatePriority("Low");
AfxBeginThread(WorkThread, this,int(p riority),0 );
For some strange reason this crashes.
Any ideas?
Priority is generated from a CComboBox like this:
DWORD CAutoPeaksDlg::TranslatePr iority(str ing str){
DWORD ret = IDLE_PRIORITY_CLASS;
if(str == "Highest")
ret = REALTIME_PRIORITY_CLASS;
if(str == "High")
ret = HIGH_PRIORITY_CLASS;
if(str == "Above Normal")
ret = ABOVE_NORMAL_PRIORITY_CLAS S;
if(str == "Normal")
ret = NORMAL_PRIORITY_CLASS;
if(str == "Below Normal")
ret = BELOW_NORMAL_PRIORITY_CLAS S;
if(str == "Low")
ret = IDLE_PRIORITY_CLASS;
return(ret);
}
Thanks,
Jens
I ran into problems, using this:
DWORD priority = TranslatePriority("Low");
AfxBeginThread(WorkThread,
For some strange reason this crashes.
Any ideas?
Priority is generated from a CComboBox like this:
DWORD CAutoPeaksDlg::TranslatePr
DWORD ret = IDLE_PRIORITY_CLASS;
if(str == "Highest")
ret = REALTIME_PRIORITY_CLASS;
if(str == "High")
ret = HIGH_PRIORITY_CLASS;
if(str == "Above Normal")
ret = ABOVE_NORMAL_PRIORITY_CLAS
if(str == "Normal")
ret = NORMAL_PRIORITY_CLASS;
if(str == "Below Normal")
ret = BELOW_NORMAL_PRIORITY_CLAS
if(str == "Low")
ret = IDLE_PRIORITY_CLASS;
return(ret);
}
Thanks,
Jens
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I got mixed up there.
And yes you are right about the implementation, i'll switch it.
Best,
Jens