|
It really depends on your needs.
I usually just use C++ streams for console I/O .
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
I'm not sure what the difference is in your mind. std::cout and std::format (C++ 20) aren't really API's in my mind. They're fine for a simple utility (think ping or netstat), writing log files or doing data I/O, but quickly become unweildly when trying to do full screen I/O like menus, dialogs, pop-ups etc. If you're pursuing the latter, then you probably want to use a library that handles all the screen painting for you, managing overlays, pull down menus, etc. You might want to look at this page to see if any of them meet your needs C++ Library TUI libraries | LibHunt
You can probably find other examples googling for C++ TUI libraries.
Keep Calm and Carry On
|
|
|
|
|
Long ago I just did it myself.
The libraries that get fancy tended to rely on stuff that I couldn't be sure existed or at least would existed in the future.
Not to mention that a console app should be pretty simple in the first place. If you need complex user interactions then a console app probably isn't the way.
If I didn't want a normal UI then I would be more likely to control it via either command line options and/or configuration files. Actually I have been doing just those for years without any need for anything else.
|
|
|
|
|
Maybe there's a simpler way to do this. Or a good tutorial ?
I have a time string formatted like this (with spaces): "07 h 08 min 51 s"
According to the documentation, should the format string should be "%H h %M min %S s" ?
And if I understand how this should work, I should be able to do something like that, no?
Is there something I am missing ? or just the documentation too obtuse ?
const std::string time("07 h 08 min 51 s");
const std::string format("%H h %M min %S s");
std::chrono::time_point<std::chrono::system_clock> tp;
std::stringstream iss(time);
iss >> std::chrono::parse(format, tp);
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
You failed to say what the problem or question is.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Your time string doesn't fully specify a time point. You can change it to:
std::chrono::duration<int> d;
iss >> std::chrono::parse (format, d);
and d is correctly calculated as 25731, which represents your time converted to seconds.
In the docs the key point is:
Quote: If from_stream fails to parse everything specified by the format string, or if insufficient information is parsed to specify a complete result, or if parsing discloses contradictory information, is.setstate(std::ios_base::failbit) is called. (highlight is mine).
Mircea
|
|
|
|
|
thanks.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
I found the following article from MS at - 'MS Learn - <chrono> functions[^], scroll down to the Time of day tab which might be what you are looking for.
|
|
|
|
|
please can anybody explain me
how i convert my x86 project in x64
when i change it in configuration manager and set to x64
it gives error like
<br />
Error 1 error C2371: 'ULONG' : redefinition; different basic types C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\intsafe.h 65 1 Rec_Pen_drive<br />
<br />
plz help for this
|
|
|
|
|
It may be that you are including a 32 bit header somewhere that is confusing things.
|
|
|
|
|
ok
thank you to guide me in right direction
|
|
|
|
|
on toolbar, change debug and release setting to win64
|
|
|
|
|
Hello! Need some help - trying to use icon in a Group Bar (Visual C++ 6) instead of text. I mean - Group Box properties, "Styles->Icon". Is it possible? Thank you.
|
|
|
|
|
If it supports text, then use a font icon; e.g. Emoji, etc.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
No, it supports icon/bitmap - I can choose each option but can't find pointer to necessary icon or bitmap.
|
|
|
|
|
If you can select the icon then look at the documentation for details of how to use it.
|
|
|
|
|
Excuse me for asking, but why would you still be using VS6? Seems to be a 20+ years old product and there have been innumerable versions after that. I seems to remember having used it long time ago but any memory has been lost in the darkness of time.
I'm sure you must have a good reason and I'm asking only out of curiosity. Please don't misinterpret it as a critique or something.
Mircea
|
|
|
|
|
Hi everyone,
I created a report program where a from/to date range is selected to display that range of reports to a listview control.
The problem: If that range crosses a shift from standard time to DST you lose a day.
Example: Mar 11 2023 to Mar 12 2023 time period is 0 days and only Mar 11 2023 is shown even though the range is 11 to 12th.
Does anyone know what or if there is a fix for this?
This is my first post so please advise if I am not using this correctly.
Thank you,
Steve
|
|
|
|
|
Are there any reports in the data store dated Mar 12th?
"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
|
|
|
|
|
Apologies yes! Mar_11_2023_hst.txt and Mar_12_hst.txt
I saw someone else had commented that maybe my time in hours is not 24 since you lose the 2am hour from daylight savings time. I think that may be the problem. i will post when i get a chance to look at it.
Thank you.
|
|
|
|
|
You provide to little information to be able to help. What data store are you using? How are the dates stored? In what time units you calculate (days, hours, seconds)? For instance from Mar 11, 2023 03:00:00 to Mar 12, 2023 03:00:00 there are only 23 hours so your system might say it's less than a day.
Having worked for a long time with time, my advice is to always use UTC. It's the only (almost) uniform time scale and computations to and from local time can be handled relatively easy.
Mircea
|
|
|
|
|
Mircea Neacsu wrote: always use UTC When I suggested that to the designers and team leaders driving the last commercial project that I worked on, the answer was, "No, we need to keep track of transactions by local time".
Fortunately the project was canned not long afterwards.
|
|
|
|
|
Richard MacCutchan wrote: we need to keep track of transactions by local time
Not surprised. I've seen the same attitude by one of the habituals in the lounge. People don't understand that local time is mostly an expression of political will rather than a time scale.Even with UTC some forget about the occasional leap second but at least Earth is not playing any political games.
Best put by Dr Who: Big ball of wibbly wobbly... time-y wimey... stuff.[^]
Mircea
|
|
|
|
|
That I can understand.
|
|
|
|
|
Hi Mircea,
I think you might be onto something here! I will check my code and probably even use UTC and end this little problem. Thank you.
|
|
|
|