I started on Windows, switched to Linux. For a period I maintained both systems, now I maintain Linux only (I haven't booted to Windows the last 3-4 months or so).
|a bunch of redundant stuff, which I want to keep my library from doing. What do you guys suggest? |
You have to tell us more about your project. What does it do? Aims/Goals?
To handle input/output in my program I use pointers to functions. For example, I have a data structure with a pointer to "display-text function" which takes arguments strings. I hook up a display function run-time. In this way, all system-dependent code is located in a single file, which provides pointers to all input and output functions to my system. All my system-dependent functions can be initialized with 0, signifying "do not call anything".
To handle mutexes and other system-depend structures which do affect program flow, I still use pointers to functions. I create my own mutex class with a static pointer to a "create-mutex" function. At run time, the system changes the pointer to create-mutex-function. This way all system dependent code is kept outside of my main code.
The result: except for one file, containing main(int), my system compiles using only std:: includes on all systems, yet takes advantage of mutexes, i/o, system tyme, etc., by changing a few function pointers at run time (usually, in the main(int) function).
With that said, here is my take on GUI
I started using
first) pure WINAPI
second) FOX toolkit
only to finally switch to
Apache web server + std::cout output in html.
My conclusion is that WINAPI, and any related programming is total and utter crap. Whoever designed it was learning how to program at best. That is not such a negative statement: back in the 1980's many programming techniques didn't exist. in the 1980's, everyone was learning how to program (and in a way still does). However, it appears some people were talented at it and others (many working at Microsoft) weren't.
2)As far as mutexes and similar go:
Back in 2010 I was using a *completely legal*!!!!! version of Windows XP. Yet, certain standard mutexing structures documented on MSN didn't work. I would have had to change my program flow from using mutexes to some other microcrap structure. I decided instead to drop Windows support. My code still works on windows, but I substituted proper mutexing with a non-guaranteed-to-work infinite loop emulation.
Moral of the story: use Linux.