|
Hi
I have C/C++ solution/project
The parent process is C the child process is MFC C++.
Each in its own project
The C project has a number of threads.
I have a quad core laptop.
Is there any way of knowing how many cores the .exe(s) is/are using. Don't know if task manager is the answer.
More so can I have an affinity of a thread to a core ?
Thanks
|
|
|
|
|
It is all handled by the operation system. Don't care about. While it is possible to set a thread affinity it is usually not necessary and often counterproductive.
If a process has multiple threads it will use multiple cores when available. But there is no single core assigned to a specific thread. The OS assigns the cores so that a thread runs on different cores.
|
|
|
|
|
Is there anything in task manager or VS debugger or maybe the Kernal debugger that would show me any information about this
Thanks
|
|
|
|
|
Showing information about the core that runs a specific thread makes no sense due to the fast switching between the cores.
For process information have a look at the Sysinternals Suite[^].
|
|
|
|
|
Thanks so much
|
|
|
|
|
I wanted to make a program like this:
A bank in Indonesia want to create a program using the order of priority. The purpose of this program is to provide the serial number to its customers. No sequence given later be called by the program so that customers who have no it can go to the teller who had been appointed.
The problem in the bank there is a priority system that puts people who have a priority, so that when the customer has priority can be called up in advance from customers who do not have a priority. Create a program using DLLC to overcome this!
|
|
|
|
|
|
Sorry, but no one here is going to do your work for you. Give it a try, and if you have a specific technical question then come back and people will try to help you.
|
|
|
|
|
Okay, and?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Yudha Eka Saputra wrote: Create a program using DLLC to overcome this
No thanks. I would change banks if my bank started treating customers this way.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
Hi...
I am trying to migrate a large MFC solution from VS2005 to VS2015. The solution contains 170 projects. After a lot of work, all projects compile and 168 of them link. One that does not link is petty, but pesky, and I may return to that in another post. The other that does not link is the project that generates the program executable.
* The error that it generates is LNK1104: Cannot Open 'mfc80d.lib'.
* If I ignore MFC80d.lib, I get LNK1104: Cannot Open 'mfcs80d.lib'.
* If I ignore that, I get LNK1104: Cannot Open 'daouuid.lib'
* And if I ignore that, I get any number of undefined externals such as CRect::...(), CSize::...(), CFile::...() and so on. This is presumably because I am not linking MFC at all.
I have found a lot of discussion about this but none of it seems to help me. I can find no explicit or implicit references to MFC 8 in my properties or any project file. I have searched for 'mfc80d' both internally in VS2015 and externally in the Windows 7 search tool.
My target platform is 8.1 and my platform toolset is 140.
I will begin configuring a release build next week after the new year.
Can anyone offer any suggestion?
If I may slip in a second question, do I need to worry about migrating DAO?
Thank you very much for any help that you can offer and have a Happy New Year.
SPC
S.P. Chapman
Digital Engineer
Radiant Technologies, Inc.
Albuquerque, NM.
radiant@ferrodevices.com
|
|
|
|
|
Your project is attempting to link to the old version of the MFC libraries (mfc80xxx). You need to edit the project properties to use the ones that come with VS2015. No idea about DAO, sorry.
|
|
|
|
|
As Richard said you are linking the lib files manually of which there are only three ways to do
1.) #pragma comment(lib, "mfc80d.lib") .. given you have searched for mfc80d.lib it can only be a macro name so just search for "#pragma comment". Something stupid like #pragma comment(lib, "mfc" _MFC_FILENAME_VER "d.lib")
2.) Under project properties Linker->Input->Additional Dependencies .. look for the name
3.) Under project properties Linker->command Line->Additional Options .. look for name (its usually blank)
Has to be in one of those 3.
daouuid.lib is an obsolete XP service pack 2 library file it wont be available in none XP builds. There is an XP build option on VS2015 it will probably link in that build.
In vino veritas
modified 31-Dec-16 9:14am.
|
|
|
|
|
I did, indeed, find "#pragma comment(lib, "mfc" _MFC_FILENAME_VER "d.lib")" in Afx.h under C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include\afx.h. However, _MFC_FILENAME_VER is declared by:
#ifndef _MFC_FILENAME_VER
#define _MFC_FILENAME_VER "140"
#endif
in afxver.h.
I tried adding the declaration explicitly to the project StdAfx.h file but it made no change to the linker error. "#pragma comment" is not found anywhere in the project itself. There are no explicit references to MFC 80 in the linker settings.
Once I get a few beginning of the year things cleaned up, I am going to try a release build.
As for DAO, I am no longer targeting XP or Vista. I will need to fight that battle once I win this one.
Thanks for your advice. I will continue to tilt at this as I may, but I may be stuck with VS2005 compilations for some time.
Happy New Year to you.
FF
|
|
|
|
|
The simpler way is simply delete all the project and solution files and set them up from scratch using the create project from existing code option on the menu
In vino veritas
|
|
|
|
|
Yes, I am just about to that point. I have been redirecting my energies the past week or so, so I haven't had at this problem very much. I was actually considering moving the older library files into the project just to get things to link. I haven't tried a release build, yet, but if the release build does not link, moving the older files may resolve the problem but then cause a distribution nightmare, requiring 2005 and 2015 manifests. A new project with old code and resource files is a much better approach.
Thanks for your time
SPC
|
|
|
|
|
If any of your projects links another 3rd party library, that library, too, needs to be compiled with VS2015 - otherwise it will attract old MFC libs.
There's a very useful tool called depends that can show for each executable or dll what other binaries it depends on. You can use it to locate the dependency path that is responsible for attracting mfc80.dll. See Dependency Walker (depends.exe) Home Page[^]
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
Hi Stefan...
Thanks for the observation. And yes, I have been pursuing this same line. I am having trouble getting a reply from the the third party vendor. Meanwhile, other matters have pushed this to the side, so I haven't been giving it a lot of attention.
I will leave this reply up for the weekend, then remove/resolve this message.
Thanks again and have a great weekend.
SPC
|
|
|
|
|
Hi. I have noticed something interesting: in an MDI app, I handled ON_WM_SHOWWINDOW() in CChildFrame , just like this:
void CChildFrame::OnShowWindow(BOOL bShow, UINT nStatus)
{
CMDIChildWnd::OnShowWindow(bShow, nStatus);
TRACE("%d\n", bShow);
}
and whenever I create a new childframe (several times), I see the TRACE, so, this message are handled.
But, if I maximize the child frame, the next childframes opened are not handle this message at all ... why ? Strange ... once I maximize the childframe, whenever I create the new childframes, this message are not handled (I mean, I don't see any TRACE) ! If I restore the child frame, next child open are handle this message ... why ?
Thank for any explanation, words, everything !
But,
|
|
|
|
|
|
Thank you ... I wonder how to know for sure when a childframe have been created ... I will do some tests.
|
|
|
|
|
Same way as your last question handle the WM_CREATE message of the child window (or WM_MDICREATE of the parent MDICLIENT) and you know when it's created.
It's a basic thing if you want to know absolutely about something (without delay) then insert code in that handler instead of trying to determine it from a parent or associated window where the message chain gets involved. It's easier and safer than the alternatives.
The other key things with MDI's is children will by default be handled by DefMDIChildProc and be inside an MDIClient window (which is like an invisible window that sits inside an normal window) for them to operate correctly. So basically your app window contains an MDICLient, and the MDICLient contains the MDI children. So be careful the children are not actually children of the APP window as such. If you try to insert an MDIChild directly into a normal window it won't operate correctly they must be in an invisible MDIClient window pane.
In vino veritas
modified 30-Dec-16 4:54am.
|
|
|
|
|
Kindly thank you for your information. Actually I want to setup the window placement which have been saved in CChildFrame::OnDestroy() :
void CChildFrame::OnDestroy()
{
CMDIChildWnd::OnDestroy();
WINDOWPLACEMENT wp;
GetWindowPlacement(&wp);
if(wp.showCmd == SW_SHOWMINIMIZED)
wp.showCmd = SW_SHOWMAXIMIZED;
AfxGetApp()->WriteProfileBinary(_T("Settings"), _T("WindowPlacementChild"), (LPBYTE)&wp, sizeof(wp));
}
and previously I setup the window placement on first CChildFrame::OnShowWindow call:
void CChildFrame::OnShowWindow(BOOL bShow, UINT nStatus)
{
CMDIChildWnd::OnShowWindow(bShow, nStatus);
if(bShow && ! IsWindowVisible() && m_bOnce)
{
m_bOnce = FALSE;
UINT nBytes = 0;
WINDOWPLACEMENT* lwp;
if(AfxGetApp()->GetProfileBinary(_T("Settings"), _T("WindowPlacementChild"), (LPBYTE*)&lwp, &nBytes))
SetWindowPlacement(lwp);
delete []lwp;
}
}
but I discovered that this handler are not called when the previous child frame open are maximized ... where should be the proper place to set the child frame placement on opening ?
modified 30-Dec-16 6:32am.
|
|
|
|
|
"Same way as your last question handle the WM_CREATE message of the child window (or WM_MDICREATE of the parent MDICLIENT) and you know when it's created"
You mean on creation of child frame ?
|
|
|
|
|
I don't think that WM_CREATE is the right place to set child frame placement:
int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
UINT nBytes = 0;
WINDOWPLACEMENT* lwp;
if(AfxGetApp()->GetProfileBinary(_T("Settings"), _T("WindowPlacementChild"), (LPBYTE*)&lwp, &nBytes))
SetWindowPlacement(lwp);
delete []lwp;
return 0;
}
Once as I put here this code, I have not child frame system menu anymore.
|
|
|
|