|
Do you need to these messages?
BEGIN_MESSAGE_MAP(CMyStatic, CStatic)
ON_WM_HSCROLL()
ON_WM_VSCROLL()
END_MESSAGE_MAP()
void CMyStatic::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CStatic::OnHScroll(nSBCode, nPos, pScrollBar);
}
void CMyStatic::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CStatic::OnVScroll(nSBCode, nPos, pScrollBar);
}
public:
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
public:
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
|
|
|
|
I have added these messages to the class, but the event is not coming ..
Hi this is SHivraj
|
|
|
|
|
Do you have these scrolls on the control and can you see them when run your program?
|
|
|
|
|
Hi
From the main thread of my NFC based SDi application, i am creating a UI thread. Now from within the UI thread, i am creating a worker thread that does a very crucial job.
This worker thread has the tendancy to hang in certain situations.
To handle this hang sitaution, i wait on this worker thread from my UI thread for a max of 60 seconds using WaitForSingleObject(pThread->m_hTread, 60000).
Please have a look at the code snippet:
//This is a function in my UI thread.
BOOL CDocRecover::QuickRepair()
{
---
--- //some code goes here.
---
//Now here i am creating a worker thread.
CWinThread* pThread = AfxBeginThread(Worker_ThreadSample, wordDocs);
DWORD dwReturnValue = WaitForSingleObject(pThread->m_hThread, 60000);
if(dwReturnValue ==WAIT_TIMEOUT)
{
DWORD lpExitCode = 0;
GetExitCodeThread(pThread->m_hThread, &lpExitCode);
while(TerminateInstance(TRUE)==TRUE);
if(wordApp1.m_lpDispatch)
{
wordApp1.ReleaseDispatch();
wordApp1.Quit(covFalse, covTrue, covFalse);
DeleteFile(pApp->strTargetPath);
}
if(lpExitCode==STILL_ACTIVE)
AfxEndThread((UINT)lpExitCode);
}
int dp=0;
}
Now assuming that the worker thread has hanged, after waiting for 60 seconds the control will come inside the if(dwReturnValue ==WAIT_TIMEOUT) block & worker thread will be terminated after releasing some dispatch.
Now the problem is that after the call to AfxEndThread(), the control never reaches the line int dp=0;
I DONOT KNOW WHY?
The Application has not hanged but the control never returns to the UI thread.
Please suggest
|
|
|
|
|
is this "Worker_ThreadSample" function that you are using in afxbeginthread, a global function or a part of the class CDocRecover.
if it is a global function, then no problem.
have you tried to debug the application,
or have you tried by putting some messageboxes
|
|
|
|
|
Hi
Worker_ThreadSample(0 is a controlling function of the worker thread defined globally.
Waiting for suggestions
Regards
|
|
|
|
|
have you tried to debug the application,
or have you tried by putting some messageboxes
|
|
|
|
|
This is a poor design. If you start a worker thread, then immediately wait for
it to complete on the creating thread, then you've essentially gone out of your
way to create a single thread.
Regardless. does execution ever get to AfxEndThread()?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How to identify , in which angle image is rotated or skewed?
|
|
|
|
|
Do you need to this method Image::RotateFlip ?
|
|
|
|
|
jay_p_patel wrote: ...but it fails .
Which is all but totally meaningless without any contextual information.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
what could be done to get rid of link error 1181 cannot open input file d:\project.obj
|
|
|
|
|
to get your post clarified, you have to narrate the foreground and background of your problem and error.
you should also specify the platform in which you are getting this error.
|
|
|
|
|
You've instructed the linker to process the d:\project.obj file, which apparently does not exist. I suspect the d:\ path is invalid as most .obj files reside in a project's Debug or Release folder.
LNK1181
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello to all,
i am a new one in MFC, right now in my project i am having a default ".rc" file lets say "a1.rc" which is created while generating the project.Now i want to create and add one more ".rc" file lets say "b1.rc" in my project along with "a1.rc",how to do it? i want to add one dialog box and some other resources in "b1.rc",how it can be done? also i want to generate new "resource.h" file for new "b1.rc" file so that "b1.rc" will not overwrite existing "resource.h" file for "a1.rc", how it can be done? how to give reference of this "b1.rc" file in my project? can any body help me please.
Thanks and Regards,
Anay Kulkarni
|
|
|
|
|
Hi anil,
There is only one resource file in a project and what u want, u can do it in existing resource file also. Go to Insert Menu -> resource (resource dialog box appear)than u may insert what u want and resource.h is automatically updated.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
what i under stood from his post is he might be looking to import one dialog box from another projects' rc file into his new project.
so he can open that rc file by importing it into his current workspace and copy paste the controls from the required dialog to the new dialog.
|
|
|
|
|
No Chandu,
he create one more .rc file in his worksapce. pls read his blog.He create one MFC workspace where .rc file is already created. now he want to generate one more rc file and according to my knowledge it is not possible.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
yah shilpi, what you said is correct.
it is not possible to have two RC files in one project,
but now atleast iam unable to understand, why at all he requires two RC files in one project?
|
|
|
|
|
Hans tells you how to do it in this article[^]
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Unless something has changed over the years, you can just go in and include it manually in the existing ‘.rc’ file using ‘#include”, I think, just like a C or C++ header.
If you need to be sure how it is done, then just add an external file like a bitmap to your ‘.rc’ through the IDE and then open the ‘.rc’ (in text mode) to see what statement it added. Heck, come to think about it; that is all you should need to do to add an additional ‘.rc’ file within the existing file.
I once need to create the same version of an application with different logos and about information (sister companies) and it X was defined (for project) then X companies information would compile and show, otherwise company A’s information would show.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
|
Anybody know how to get CPU temperature from the system.
what the function can support this issue.
Thanks
|
|
|
|
|
not all machines can support reading of the cpu temperature, it's a function of your BIOS software. Sometimes the bios manufacturer will supply dll's that you can reference to call the required function and return the details.
|
|
|
|
|
See Win32_TemperatureProbe .
|
|
|
|