|
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
|
|
|
|
|
I'm writing a App to scroll the window which is not foreground with the mouse wheel, And Use the Mouse hook In my code, first i reDirect the message like this:
POINT pt;
::GetCursorPos(&pt);
pMHSEX->MOUSEHOOKSTRUCT.hwnd=::WindowFromPoint(pt);
but this do not take effert so i change the code :
POINT pt;
::GetCursorPos(&pt);
pMHSEX->MOUSEHOOKSTRUCT.hwnd=::WindowFromPoint(pt);
::SendMessage(pMHSEX->MOUSEHOOKSTRUCT.hwnd,WM_MOUSEWHEEL,pMHSEX->mouseData,0);
return TRUE:
this works in many windows (foreground or not foreground with scrollbar inside) when the mouse move on it with the wheel scrolled, these window were all act,but when the mouse move to the IE window with Scrollbar then scroll the mouse wheel it does work
I have searched some article, and some about the window whose class name is "Internet Explorer_Server", and i try to test:
#define ID_IE_ID_ADDFAV 2384
::SendMessage( pMHSEX->MOUSEHOOKSTRUCT.hwnd, WM_COMMAND,MAKEWPARAM(LOWORD(ID_IE_ID_ADDFAV),0x00), 0);
it appear a IE add favorite window, but how do i send a Scroll meesage to this window ?
Can someone help me? Thanks
modified on Tuesday, June 24, 2008 7:14 AM
|
|
|
|
|
I have to get the total count of the files present in a folder.I have to do a file transfer from that folder to another on a button click.Any help?Im using vc++
|
|
|
|
|
try FindFirstFile() and FindNextFile() or its MFC wrapper CFileFind to find the number of files in a folder
If you want to copy the entire contents of folder at once use SHFileOperation or if you want to copy one by one, use CopyFile() .
|
|
|
|
|
Please check my code...
void CMydlgtestDlg::Oncount()
{
int count=0;
CFileFind f;
CString file="D:\\mframes";
if(f.FindFile(LPCTSTR(file)))
{
count++;
f.FindNextFile();
}
AfxMessageBox(count);
|
|
|
|