|
hemlat wrote: AfxBeginThread( CRuntimeClass* pfnThreadProc,LPVOID pParam, int nPriority = THREAD_PRIORITY_NORMAL,UINT nStackSize = 0, DWORD dwCreateFlags = 0,LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL);
What is this? Are you trying to call AfxBeginThread() , or just duplicate the prototype?
"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
|
|
|
|
|
Actually I dont know how to create thread.I have tried with above code.I am seaching the code for thread creation.
|
|
|
|
|
hemlat wrote: I am seaching the code for thread creation.
Quote Selected Text
Still?! Are you kidding me?
I gave you link to an excellent UI thread tutorial yesterday. Did you read it or not? Why are you "searching" for code, BTW? You're supposed to write code if you are a programmer of any kind.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks for your reply.Just now I have started working.Morning I was busy with some other task.Just I replyed to his message he was asking me what I was doing.I started working on Link which u hv sent.
|
|
|
|
|
I need to create worker thread.Because I need to put my functionality in thread function. Can you suggest any link which will show how to create worker thread
|
|
|
|
|
Bookmark the MVP Tips[^] page. There's plenty of good essays there.
Look for "Using Worker Threads" essay for your purpose.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
thanks for your reply.I have created thread.I got article in Codeproject.Sorry for late
reply.
|
|
|
|
|
hemlat wrote: Can you suggest any link which will show how to create worker thread
Did you even bother to read the article that Rajesh provided? If you had, you would have noticied a link to this.
"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
|
|
|
|
|
hemlat wrote: UINT CTestcycleDlg::pfnThreadProc(LPVOID pParam )
i think you forget to make function static
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hello,
I am dealing with a problem and I would need your help.
I have two top most windows, and i want to always have one of the windows in front of the other. The solution that makes one of the windows a child of the other cannot be applied in my case.
Thank you for your help.
|
|
|
|
|
You could use the topmost style (See SetWindowPos) for the Upper window, but it's not a very scalable solution (2 works, 3 would not)
I'd have another look to see why making one a child of the other would not work first before you kludge it.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Thank you Iain for your answer. The solution with one child of the other works perfectly, but the reason why i was searching for another solution was that the number of windows involved isn't in fact 2, it could be bigger, so i will need to change dinamically the parent of my "upper" window. You said to use the topmost style, both of the windows are made TopMost using the SetWindowPos method. You mean maybe the WS_TOPMOST style.
|
|
|
|
|
I meant ::SetWindowPos (hWnd, HWND_TOPMOST, ...), but was being sloppy about it.
If it's N, then you'll have to get over your aversion to windows being children of other windows...
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
OK, thank you, i guess i will have to try to solve it this way
|
|
|
|
|
Hi,
I have some powerpoint addins which are to be added to powerpoint programmatically.The problem in the below code is it always says power application object cannot be created while running the program. but powerpoint application object will create during debugging the program.
hence I am not able to figure out the problem. Could any one help me please?
void InstallPptAddins(LPCTSTR strAddinPath)
{
CFileFind m_fileFind;
CString strAddin;
PowerPoint::_Application Ppt;
PowerPoint::AddIns m_pptAddIns;
PowerPoint::AddIn m_pptAddIn;
if(!Ppt.CreateDispatch("PowerPoint.Application"))
{
Log("Error:fn::InstallPptAddins() Couldn't open Powerpoint Application\n");
return;
}
try
{
if(Ppt.GetVersion()=="12.0")
{
PowerPoint::Presentations m_Sets(Ppt.GetPresentations());
PowerPoint::_Presentation m_Set(m_Sets.Add(TRUE));
strAddin = strAddinPath;
strAddin += "DSAFO5PP.ppa";
if(m_fileFind.FindFile(strAddin))
{
m_pptAddIns = Ppt.GetAddIns();
m_pptAddIn = m_pptAddIns.Add(strAddin);
m_pptAddIn.SetLoaded(FALSE);
m_pptAddIn.SetAutoLoad(FALSE);
m_pptAddIn.SetRegistered(FALSE);
m_pptAddIn.SetLoaded(TRUE);
m_pptAddIn.SetAutoLoad(TRUE);
m_pptAddIn.SetRegistered(TRUE);
Log("AFO Powerpoint add-in is added.\n");
}
else
Log("Couldn't find Powerpoint add-in %s\n",strAddin);
}
catch(...)
{
Log("Error::Couldn't install Powerpoint add-ins.Please add it manually\n\n");
}
Ppt.Quit();
}
|
|
|
|
|
missing closing curly braces for
if(Ppt.GetVersion()=="12.0")
{
|
|
|
|
|
may be missed out during caopying the code.It is proper on my machine.But that is not the reason.It is compiling with no error.
|
|
|
|
|
I have a MFC application in which I need to create a temporary editbox on the view. But that editbox does not accept ctrl+C & ctrl+V commands from keyboard. It should support copy & paste by default. I create it with WS_CHILD | WS_VISIBLE styles.
I have entered the Copy paste shortcuts into accelerator table for use in the view.
Does anyone know the reason why it does not paste in editbox? Instead it pastes in the view.
How to correct it?
TIA.
|
|
|
|
|
This is an excellent article explaining all the nuts and bolts of MFC's command routing.
http://www.microsoft.com/msj/0795/dilascia/dilascia.aspx[^]
There will be an exam to make sure you've read it before you're allowed to have any more biscuits. Ever.
Once you've read it, the following will make sense:
I think you need to add an OnCmdMsg handler to your View class, to give the temporary edit box a quick bite at the cherry. Alternatively, use the CMyView::OnEditCopy handler to send a WM_COPY message to your edit box, if it exists. (and same for paste, cut...)
Good luck,
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Hi All,
Can anybody help me to get External USB Hard Disk Drive Temperature.
Thank You
|
|
|
|
|
Do you have a temperature probe?
"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
|
|
|
|
|
As far as I know you can only get the drive temperature via SMART and this won't work over the USB interface.
|
|
|
|
|
Dear Maichael,
Thanks for your reply.Its possible because it is implemented in hdsentinel software.You can find it in www.hdsentinel.com .
Thank you
|
|
|
|
|
Hi all,
Is it just me or the "Add member variable wizard" takes FOREVER to add a control variable (something like 5 to 8 seconds to add one variable)? I wonder what is the 'magic' that it is doing while freezing the entire VS IDE for so long. If I add this same control variable by typing with my hands, I'll probably take the same time (or less may be). I'm really pissed with this "wizard" and would like to know if at all there's a solution to it.
When I go about Googling, I realize that this issue exists for quite sometime (since VS 2002 .NET days ) and a hotfix is available for VS 2002. But I'm using VS 2008 with MFC.
Thanks for any help!
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Please repost your query to Visual Studio Forum[^]. It is more likely to get an answer over there.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|