|
Why dont you try your self using GetThreadPriority() function?
|
|
|
|
|
Thanks for your help!!
I thought these functions of setting and getting thread priority are for only user defined threads, but it seems we can use them for any thread.
But setting priority to GUI thread will work?
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
rp_suman wrote: I thought these functions of setting and getting thread priority are for only user defined threads,
There is nothing called as an user defined thread. There are only two types of threads - UI and worker.
rp_suman wrote: But setting priority to GUI thread will work?
Why not try it?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Now i got it why you are called gray man
Regards,
Sandip.
|
|
|
|
|
Hi,
Thanks for your help..
I meant the thread created by user and not applications default one.
Getting or setting priority to application thread is possible, but as Cedric Moonen said, we shold take care when setting priorities.
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
I got it using GetThreadPriority() function inside InitInstance(), it is normal priority(THREAD_PRIORITY_NORMAL = 0).
--
"Programming is an art that fights back!"
|
|
|
|
|
It's not a answer to your question, but are you really sure that you want to change the GUI thread priority ? If you are still talking about the same problem as yesterday, then I guess that changing the thread priority to avoid a race condition is not the way to go. Besides, if you handle that not correctly you may end up freezing your whole system.
If you use critical section with care, that should solve a lot of your problem (even if you think this will be slower).
|
|
|
|
|
Hi Cedric,
Is that just me or nobody's CPMRU will be able to cope with this[^] post? Please tell me that I'm not alone.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
No, you're not alone
|
|
|
|
|
Hi,
I asked this to just know and not for any problem.
That problem of race condition resolved already by updating write pointer count only after current write is finish which Pallini suggested.
BTW: My current project consists of many threads, timer, callback from me and other developers, thats why I wanted to know priority level of each.
Thanks for all your help!!
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Oh my God! Is it related to this[^]? If yes, you're doing a terrible thing. Please follow the guidance given to you by Cedric.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi,
It is not related to this problem, this problem resolved already as I replied to Cedric Moonen.
Thanks & Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Hi all,
How can I pass to a string variable the content of an environment variable?
for example
string a;
I want the content of a the value of the environment variable TEMP?
Thanks,
Jayjay
|
|
|
|
|
Does this GetEnvironmentVariable(/*parameters*/) help
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks Anshuman it works now
|
|
|
|
|
Hi,
I am not sure about data type of environment variable, but if you know the data type, you can use CString variable and format it.
Refer here:CString::Format[^]
What compiler are you using?
Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
I have an application which need to start the audio/video settings on a button click. I have written code for that:
************start of code**********************************************
HRESULT hr = CoInitialize(0);
if (FAILED(hr))//CoInitialize failed
return hr;
//Obtain a pointer to the IUccPlatform interface
//by way of the cocreatable UccPlatform class.
CComPtr <IUccPlatform> pIUccPlatform;
hr = CoCreateInstance
(
__uuidof(UccPlatform),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IUccPlatform),
(LPVOID *)&pIUccPlatform
);
if (FAILED(hr))
{
AfxMessageBox(IDS_STR_ERROR_COCREATE_INSTANCE);
return hr;
}
CComBSTR bstrAppName = _T("application");
hr = pIUccPlatform->Initialize( bstrAppName);
if (FAILED(hr))
{
AfxMessageBox (IDS_STR_ERROR_INITIALIZE);
return false;
//device settings
}
CComPtr<IUccMediaDeviceSettings> spMediaDeviceSettingsPtr;
pIUccPlatform->QueryInterface( &spMediaDeviceSettingsPtr );
spMediaDeviceSettingsPtr->InvokeTuningWizard((OAHWND)theApp.m_pMainWnd->m_hWnd, UCCTWP_AUDIO | UCCTWP_AUDIO_NONPRIVATE | UCCTWP_AUDIO_NOTIFICATION);
//AfxMessageBox(IDS_STR_ERROR_INVOKE_TUNING_WIZARD);
pIUccPlatform->Shutdown();
*****************End of Code************************
and as I know we have to add the three dlls(UCCAPIRES.dll,UccApi.dll,RTMPLTFM.dll) in application project, I have done that and I also got success in that. But when I run my application on other system after clicking button to start the audio/video settings I got an error message "Error CoCreateInstance ".
If any idea then please share.
Configuration for apllication is
WindowsXp
C++ .net2005
|
|
|
|
|
Hai all,
I need to build the genprint application which is available in ..../Windows DDK../src/print/genprint sample.. application.
Please help me.
|
|
|
|
|
What did you try?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
Well, you haven't answered my question. What did you try? Where and what is the problem?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Realy i don't know how to build. I tried by build using BUILD command in dos
|
|
|
|
|
Hi all,
I am trying to create Program group shortcut both in vista and xp, and then after that i want to delete these shortcut through coding...
How can i do this......
Thanks in advance
|
|
|
|
|
|
Here[^] is the developer's guide for Picasa Web albums Data API, here[^] is the reference and here[^] is the group, where you could discuss with other developers (about specific issues) while developing applications with that very API.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|