For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
Try calling EnumDesktopWindows. I think it will give the window handles in their z-order to the callback function. I am not sure about this though. It would be fairly easy to contrive a test app to experiment with it. You might find EnumWindows will do it also. Between the two you should be able to determine what you want. Once you get the window handles in their z order you will have to determine which window is which, likely by their titles.
it's been 2 days. i'm struggle with this things. this's still new. the documented it just only help a bit. i want to check session created or not. a.k.a Connected or not. i don't know why the developer MySQL make new terms to call a thing. in this code. everytime i change something credential thing like host, port, user,pass. it return same. and return unexpected result with long zero 00000000000000 if use cout to sess. in my server i already enable X Plugin. my enviroment is Visual Studio Community 2017 c++ desktop.
mysqlx_session_t * sess;
// open session. i use port 3306 cause this my mysql default port run. but in documented it says default port is 33060. i don't know it's seperate port to access. but when i change it to 33060. the result still same.
sess = mysqlx_get_session("127.0.0.1", 3306, "root", "root", "test", conn_error, &err_code);
cout << "It's not connect";
cout << "It's connect";
// close session
I would expect a meaningful error message if one the parameters is wrong.
That generic message might indicate that it is networking problem. Because you are using localhost (127.0.0.1) it is probably not due to blocking by a firewall. You should check the port number and ensure that it is the port on which your server is listening.
Depending on the operating system, you might also us a command line utility to show listening ports (as root/adminstrator: Linux: lsof -nPi, Windows: netstat -ban).
Because you should never use such expressions. The compiler writers are allowed to handle the order of incrementation in any way they like, so the results may or may not be what you expect. Bottom line: don't do it.
This expression is undefined by the C Standard, meaning that the compiler can do anything with it, including formatting your disk or causing demons to fly out of your nose. You should consider yourself lucky that the compiler only incremented 'x' in a weird manner.
Note that even changing the compiler options (e.g. optimization) might change the printed results, so even if this "appears to work properly" on your system - DON'T DO IT!
(On comp.std.c and comp.lang.c they used to refer to a notional system, the DeathStation 9000, that would actually create Nasal Demons when it encountered undefined expressions )
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
Because "abc" is a char* string and not a wchar_t which represents a single character.
wchar_t are used to store fixed length Unicode characters like UTF-16 or UTF-32 while char can store fixed length ASCII or ANSI characters (with an associated code page) or variable length characters like UTF-8 or Microsoft multi byte characters.
Version 10.0 of the Unicode Standard is now available. For the first time, both the core specification and the data files are available on the same date. Version 10.0 adds 8,518 characters, for a total of 136,690 characters. These additions include four new scripts, for a total of 139 scripts, as well as 56 new emoji characters.
wchar_t are used to store "wide characters" (characters using an encoding that requires more than a byte). The most common used character encodings for wchar_t are UCS-2 (a subset of UTF-16) and UTF-32.
It's defined as a wide char for Unicode & UTF16 support primarily for filename name support (FAT32 LFN for example) and foreign console input.
There is also another important type in <wchar.h> which is wint_t which is the generic carrier form.
You need the concept of narrowing which take a wide character back to it's byte approximation (see function wctob). wctob | Microsoft Docs[^]
The reverse concept is widening which takes a byte character and promotes it (see function btowc) btowc | Microsoft Docs[^]
The letter conversions are controlled by the current LC_TYPE locale meaning the language type
Type something like this .. it prints the time in japanese
Newer versions of Visual Studio are installed without a makefile for the MFC library.
As I want to change some inner parts of MFC I need to compile the library.
...but without a makefile (or solution file) this is not possible.
Anybody out there which has got a working makefile for newer Visual Studios?
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.
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.
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.
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).
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.
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
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:
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?
Last Visit: 31-Dec-99 19:00 Last Update: 15-Dec-17 12:06