|
I will keep it mind for sure!
|
|
|
|
|
As you're using C++, you might consider using a std::map for the internal data structure. e.g std::map<int, account> . If you do that, then you can access an account via its account number, without searching for it
std::map<int, account> accounts;
accounts[account_no].dep(amount);
Keep Calm and Carry On
|
|
|
|
|
Hi,
In MFC, when using sending or posting message to UI in a worker threads, is better to call global ::postmessage or postmessage?. CWnd vs. MFC.
|
|
|
|
|
It does not matter, since CWnd::PostMessage is just a wrapper for the Win32 function.
|
|
|
|
|
within worker thread, could a pointer to CDialog access its member variables or even functions, nothing to do with its UI elements, without using postmessage or sendmessage?. I expect the answer is YES.
|
|
|
|
|
wizQ wrote: I expect the answer is YES. No, the answer is "maybe", as it depends on the way the code is written. Without considerably more detail about your code any answer is guesswork.
|
|
|
|
|
You probably would like to read this great Joe Newcomer's essay about using WorkerThreads
|
|
|
|
|
For those writing console apps which do you think is best?
|
|
|
|
|
"is best" for what?
|
|
|
|
|
Console apps are best for console apps. For other types not so much.
|
|
|
|
|
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.
|
|
|
|