?

Log in

No account? Create an account
In which Ben attempts to make MFC do something useful. - Adventures in Engineering — LiveJournal
The wanderings of a modern ronin.

Ben Cantrick
  Date: 2006-11-17 19:08
  Subject:   In which Ben attempts to make MFC do something useful.
Public
  Mood:ranty
  Music:Must. Restrain. Stark. Fist. OF DEATH.


Dear Win95 MFC team:

- Why can't I send a user-defined message to a CWinApp? Did it not occur to any of you big brains up there in Redmond this would be THE FIRST THING I'D WANT TO DO when I learned about user defined messages? It appears, in fact, according to one of your MVPs, that you have GONE OUT OF YOUR WAY to disable this functionality with special code in the MFC core.

- Why can't I get the hWnd or CWnd* from a CPropertySheet or CPropertyPage? In other words, HOW COME YOU COULDN'T GET CProperty<foo> right?? Was the three years inbetween Win 3.1 and Windows 95 not enough time for you to write two classes that actually worked the way that you told all us "little people" our classes had to work?

- How come NEITHER OF THE ABOVE ARE DOCUMENTED and I had to waste hundreds of my client's dollars worth of time over the last three days, writing technically correct but bafflingly non-functional, silently failing code, and then waste even more time hunting down the answers to the above questions, on the sites of non-MS employed MVPs? Who are, apparently, the only ones who have actually tried to use your code the way you say that we're supposed to use it? (Testing? What's that? We all know MS "don't do that"(TM). "It compiles, ship it!")


I hate you idiots more and more every time I try and write an MFC app that actually does something useful. In this case, it was simply to hand CWinApp any characters that came in from a serial port. But no! Being able to, you know, maybe write twenty lines (or 50 lines, or 300 lines) of code to do that would have just been too easy! If we want to monitor a serial port for incoming characters, we've got to fork off another thread (and undergo all the thread synchronization and mutual exclusion hassle that entails - even when your compiler isn't throwing random, incomprehensible roadblocks in my way), then re-implement our own message queue processing system in parallel to the one that's already there, and jump through a million other stupid, bullshit hoops that take days to understand and weeks to debug. And don't even get me started on the fact that your otherwise perfectly functional WindowsCE emulator can't seem to be assed to implement WaitForCommEvent()! All of a sudden it's no wonder that I can't find a single scrap of source code for a working MFC based WinCE terminal program! (Yeah, I found one that runs under the CLR. Great! Now my application will only have to ship with 100 megs of extra support libraries just so I can do serialGetChar()!)


I am now going to go back to what I originally intended to do, before I decided to take a chance and let you decimate my IQ with your "windows way" of doing things. I'm going to keep a public array of characters, and a freaking semaphore. It might take me all ten lines of code to do it. AND IT'LL ACTUALLY WORK.


This rant did not come about out of ignorance. I'm not a mindless MicroSoft basher; I'm trying very hard to do things the right way. Nor am I incompetent - have you seen my simple webserver written in 300-odd lines of C? But even someone like me can only go slackjawed and shake his head in amazement at this shit.

I wonder why people are trashing this pile of crap you call Windoze, installing Linux despite its baroque UI, lack of games, and nearly non-existant driver support... and then ASKING FOR THEIR MONEY BACK. Gee, *I WONDER WHY* they're doing that.

Please, please do the world a favor and go choke on your own excrement and then die a horrible, evil, nasty death. Please.
Post A Comment | 6 Comments | | Link






  User: nickhalfasleep
  Date: 2006-11-18 02:25 (UTC)
  Subject:   (no subject)
* Are you trying to get a message passed between apps in Win32? Or are you trying to target a specific UI element to fill it with data?

* If you want message passing between two apps you're writing, I have some nice reliable coe.

* WinCE? oh man I'm so sorry.
Reply | Thread | Link



Ben Cantrick
  User: mackys
  Date: 2006-11-18 03:33 (UTC)
  Subject:   (no subject)
It's within the same process, between two threads. A worker thread is monitoring the serial port, and is trying to PostMessage() with a pointer to a new'd CString to the main CWinApp.

WinCE? oh man I'm so sorry.

You and me both...
Reply | Parent | Thread | Link



  User: nickhalfasleep
  Date: 2006-11-18 02:55 (UTC)
  Subject:   (no subject)
And MFC would never hit a number that high before crashing ;)
Reply | Thread | Link



Alex Belits: iskra
  User: abelits
  Date: 2006-11-18 22:53 (UTC)
  Subject:   (no subject)
Keyword:iskra
Was it the customer's requirement to use WinCE? Is it being developed as a part of some pre-existing WinCE-based application? Otherwise for embedded system WinCE is a really poor choice.

Oh, BTW many people think, I *AM* a mindless Microsoft basher, but I think, my decision to avoid their products contributed a lot to keeping myself sane.
Reply | Thread | Link



Ben Cantrick
  User: mackys
  Date: 2006-11-19 00:19 (UTC)
  Subject:   (no subject)
Yes. No. I agree.

Indeed.
Reply | Parent | Thread | Link



(no subject) - (Anonymous)
Ben Cantrick
  User: mackys
  Date: 2006-11-20 00:18 (UTC)
  Subject:   (no subject)
Too late at this point, I think.
Reply | Parent | Thread | Link



browse
May 2015