|
Yes, some years ago with an older version of MFC as there was a bug inside...
Thanks for the response.
|
|
|
|
|
Don't, it could lead to all sorts of problems. A much better idea is to add your changes by subclassing the classes that you need to behave differently.
|
|
|
|
|
The reason for trying to get the hands on the MFC source are necessary changes (public vs. protected...) in the feature pack. Subclassing it not possible as the corresponding classes are already subclassed by the MFC feature pack itself. So, there's no access to the inner parts.
Thanks for the response!
|
|
|
|
|
Hi,
Note that I have not used MFC since ~2013 but I can tell you that you can simply copy the MAK files from the VS2008 installation folder into your VS2010-VS2012 source folder and make a few changes. I have never attempted for VS2013 and above.
I believe the last version that supported recompile of the MFC framework was VC2008 with 'nmake /f atlmfc.mak MFC' from commandline. Beginning with version MSVC2010 the MAK files were removed and recompile of the library became completely unsupported.
Best Wishes,
-David Delaune
|
|
|
|
|
Thank you all for answering. I did the VS2008 makefile way. There were a lot of new afx...cpp files to add. It did compile (and yes, it worked fine at a first glance) and I tried to go further into the replacement of some feature pack subclassed windows. Finally I've stopped as there were too many changes necessary, which might cause side effects.
Just wanted to get the beautiful MDI tear off feature of newer VS.
|
|
|
|
|
Hi,
I have created a system level service which needs APPDATA folder path which is different for each user. Is there anyway through which I can get the logged in user APPDATA folder path?
|
|
|
|
|
It is possible to get the name of logged in users from a service (you have already asked that and got an answer). Using that you can guess the the user directory path and verify it by checking if the pathe exists.
But a service should not modify user data and usually does not need to read user data.
You have not told us why you need access to user directories. Maybe there is a better solution for your problem.
|
|
|
|
|
Just a guess, since I never did it yet:
- enumerate currently logged i user using NetUserEnum or/and NetWkstaUserEnum functions to get the SID for every user;
- use these SIDs to get info for every user from registry (HKEY_USERS\<sid>\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders)
- ...
Hope, it helps (at least to move you in some potentially useful direction).
|
|
|
|
|
There is an environment variable named 'APPDATA' which has a full path.
You can get any environment variable.
So would that not be sufficient?
|
|
|
|
|
That is local to the user, not available to a service.
|
|
|
|
|
I see - that makes it clear.
|
|
|
|
|
john5632 wrote: Is there anyway through which I can get the logged in user... Multiple users can be logged in at once.
"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
|
|
|
|
|
hi,
The default integer declaration assumes a signed number. But when i tried
unsigned int a=-26;
printf("\n%d",a);
it printed "-26" only. Why?
|
|
|
|
|
Hi,
It is undefined behaviour because you have used wrong format specifier. Use %u instead of %d for unsigned int. like :
unsigned int a=-26;
printf("\n%u",a);
|
|
|
|
|
Thanks. Is it only about the format specifier? Or some other conversion happens inside?
|
|
|
|
|
Yes correct. If a conversion specification is invalid, the behavior is undefined.
If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined.
|
|
|
|
|
No, it is most definitely NOT undefined behavior. This is exactly the behavior one should expect. The variable a has the binary value of -26 decimal, or 0xFFFFFFE6 in 32-bit hexadecimal. When it is passed to printf with a %d format specifier it will be interpreted as a signed decimal value and -26 is printed. There is nothing undefined about that. It is interpreting the variable exactly as the format specifier is defined to. It may not be what you want but it is as expected.
|
|
|
|
|
Rick York wrote: It may not be what you want but it is as expected.
"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
|
|
|
|
|
Introduction to the data:
NOAA's National Centers for Environmental Information collects global climate data and aggregates this data to provide information on climate trends and variability. One product they offer is a monthly regional analysis. The following table gives "anomaly" data by continent for January 2017. "Anomaly" means the value is the temperature difference from the average temperature from years 1910–2000.
Continent Anomaly (C)
North America 3.18
South America 1.36
Europe -0.12
Africa 0.53
Asia 1.92
Oceania 0.98
Assignment task:
Your task is to develop an algorithm that would sort data such as these from least to greatest. Specifically, given an unsorted set of N decimal values, your algorithm should sort them to give an answer of the sorted data. For this set of N = 6, your algorithm should produce:
-0.12
0.53
0.98
1.36
1.92
3.18
Execute your algorithm for a different set of data, such as a subset of the given data, data you make up, or another month's climate data, such as February 2017: https://www.ncdc.noaa.gov/sotc/global-regions/201702
Does your algorithm work for any N? Have you thought of corner cases it might need to handle, such as N = 0 or N = 1?
|
|
|
|
|
|
Sorry about that! First time using this website.
|
|
|
|
|
|
I'm seeing the word you/your seven times in that post. Somehow I do not feel that translates to us.
if you need help with something you did, feel free to post the code, tell what it does or doesn't do, what it should do, and what you've tried. Ask specific questions, rather than broad questions.
"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
|
|
|
|
|
Hi , I read a block of code, there is a function like:
void funcA( unsigned int * dtc, unsigned int* status)
{
int rval;
unsigned int* lstatus;
rval = funcB(dtc, lstatus);
.....
}
int funcB(unsigned int *idtc, unsinged int* istatus ) {
*istatus = XXX;
}
I understood, lstatus is not initialized, is that good way to use a local pointer like the above?
|
|
|
|
|
That code will not work.
You are correct to question it.
If the code actually runs it is only because of the way that the compiler lays down the stack and/or what the exact code did just before the first method was called.
In the method the pointer is considered to be non-initialized but because it is a pointer that was created on the stack it will have a value, whatever was in the memory that the stack is using at that point. Thus correctly stated 'garbage'.
|
|
|
|