|
Hi,
How can I get zonal id like "America/New_York" in c++?
|
|
|
|
|
|
no, this will return result in DWORD, I am looking for zone name in a string.
|
|
|
|
|
|
I am facing some problems to install the java compiler. actually in my knowledge I have installed the java compiler and also edited the enviorment variables on my pc.
PS E:\java> gcc main.java
gcc.exe: error: main.java: Java compiler not installed on this system
PS E:\java>
|
|
|
|
|
Perhaps, the Java Discussion Boards[^] would be a better place for this.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Anyway, as far as I know. The java compiler is called javac . Hence, the correct command line should be:
javac main.java
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
You are right. Thanks Bro
|
|
|
|
|
And you are welcome!
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
My secondary windows (output, find results, ... ) are all misplaced.
For example, when I do a search in files and I click on a result, instead of showing the code window in a new tab next to my other source code windows; it opens up a tab in the search window.
(if it makes sense)
Any Ideas ?
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
What version of VS?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
The latest (not preview version)
It looks like the windows are all tools windows or all are not tools windows.
alt-tab cycles between all of them.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
I thought there was an option in Tools/Options to reset the window layout.
If that doesn't work, you can do a Repair from the VS Installer, and that will surely set everything back to the way it was out of the box.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Try Tools/Customize; down should drop the list of (most unticked) options for the interface look. Mine's defaulted at "standard", the only ticked box. But there's a hayrick-load of other untested to toss your implements into and have a go.
(have not tried this suggestion ... too timid a developer I'm afraid)
|
|
|
|
|
This is an observation rather than a question - if it's not appropriate I will happily delete it.
I was wondering what would happen if multiple calls were made to SentNotifyMessage() (where the receiving window is owned by a different thread) during the period that the receiving thread was still processing the first such message it received. My guess as that the thread would be deemed hung and that SendNotifyMessage() would fail. Wrong!
The documentation says "...If the window was created by a different thread, SendNotifyMessage passes the message to the window procedure and returns immediately; it does not wait for the window procedure to finish processing the message."
Saying that it "passes the message" I think makes it clear that the message doesn't go into the same queue as messages posted with PostMessage().
I set up an experiment (on Windows 10) where the thread which owns the window 'hangs' itself (simply by sitting in a tight loop waiting for a period time to expire) for a substantial period of time when it first receives a message. The thread which sends the messages sits in a loop continuously sending a large number of messages (using SendMessageNotify). Using TRACE output to monitor what was happening I could see that all of the calls to SendMessageNotify() succeeded and happened whilst the receiver was hung processing the the first message. When that hung period expired it then received all of the remaining sent messages in succession. This worked with 100,000 "queued" messages. I was surprised. Windows obviously queues these messages and can cope with a very large number of them.
|
|
|
|
|
|
Agreed, it's not something I would rely on. I was just intrigued to discover that there is some sort of undocumented queue for sent (as opposed to posted) messages.
|
|
|
|
|
If I call SendMessageTimeout() with the flag SMTO_ABORTIFHUNG and a finite timeout period then it could fail (return 0) due to either of these reasons:
1. Timeout (the thread which owns the window started processing the message but didn't complete it within the timeout period).
2. The thread which owns the window was considered to be hung, so didn't (and won't) process the message.
In the first case GetLastError() returns ERROR_TIMEOUT (1460). I can't find any error codes in winerror.h which look relevant to the second case (hung thread).
What I actually want to know, immediately after SendMessageTimeout() returns, is whether the thread which owns the window has or will actually start processing the message. I don't need nor want to wait until it has finished processing the message.
I've spent a couple of hours searching the web and reading various articles, questions etc. but not found an answer to this.
A little while later... I've set up a test case where the window owning thread is spinning in a loop, and then I call SendMessageTimeout(hWnd, WM_MY_MESSAGE, wParam, lParam, SMTO_NORMAL|SMTO_ABORTIFHUNG, 1000, &dwResult).
SendMessageTimeout() immediately returns 0 as expected, and calling GetLastError() returns [drumroll...] 18 (ERROR_NO_MORE_FILES)!!! Go figure...
So it seems there are 2 yucky ways to trap this:
1) Wrap a timer around the call to SendMessageTimeout(), and if it returns in less than the timeout period (1000ms in the example above) then we know it failed because the thread is hung.
2) Test GetLastError(), if it's ERROR_TIMEOUT then we know it's a timeout, if it's ERROR_NO_MORE_FILES then we assume it's because the thread is hung. Or maybe if it's NOT ERROR_TIMEOUT then assume it's because the thread is hung.
Method 1 is smells of kludge, method 2 relies on undocumented behaviour.
And while we are on undocumented behaviour, it seems that passing a timeout value of 0 means "infinite timeout" although no doc I can find for SendMessageTimeout() mentions that.
And some time later again... Well the behaviour is inconsistent. I've also had it fail (return 0) immediately with ERROR_TIMEOUT, and bizarrely sometimes fail immediately with error code 0 (ERROR_SUCCESS). This is Windows 10. It seems that all bets are off in trying to interpret the return value and/or error code.
modified 12-Mar-24 8:27am.
|
|
|
|
|
I would suggest that you raise this on one of the Microsoft support forums, as it will then get through (in time) to the people responsible.
|
|
|
|
|
Yes, good idea. Thinking about it I probably should have posted this under Windows Development not C/C++ (ditto my following post about SendNotifyMessage()).
|
|
|
|
|
MikeBz wrote: because the thread is hung.
In my experience attempting to definitely trap that is just not going to work.
The states that one can reliably define for a thread
1. It worked. Worked can include returning an error result (of any sort.)
2. It took too long.
For the second case one might try to hypothesize about the cause. And then perhaps collect information, even over time, that allows one to narrow detectable types of failures.
But one should never expect that they can detect and certainly not correct all possible errors. All one can do is reduce the failure rate to a point where it can be ignored.
|
|
|
|
|
Understood, thanks for your reply. I'm looking at some not-very-well-designed legacy code and trying to work out whether its attempts to deal with a potential deadlock are flawed. Given that it's over 20 years old and nobody has complained it's probably better to just leave it alone.
|
|
|
|
|
Okay, I know this has got to be easy, but my search-fu is failing me.
I am lifting a VC6++ project written 20+ years ago to VS2022. There are a few burps along the way with some changes to MFC. Fine. In a past project, we had to move some EVC++ code to VS2008, and Microsoft really did not make it easy in some areas, moving things around - like the process of adding an event handler - they deleted the wizard and came up with a new model.
Fast forward 10+ years, and I'm facing the same struggle with VS2022. I'm trying to fix a menu issue in the MDI application with a drop down event handler. Part of my debug is I am trying to create a simple MDI application and add this event handler, but for the life of me, I cannot find where VS2022 does this.
Can someone point me in the right direction? I know it's got to be there.
Thanks
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
|
I'll give it a shot. Part of my problem is that I am still in google can find everything mode. Microsoft went and protected themselves - rightfully so - from google farming them.
I also have a bias against Microsoft support and forums. It's mostly filled in with useless drivel, "hi, I'm an independent contributor. I will help you. Have you rebooted your computer lately?" "Please follow the next 42 random suggestions, etc."
But I've not been to the developers forums in a while - that's against me.
Thanks.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|