[ View menu ]

Windows Programming and More Panic

Yesterday I grinned like an idiot for a little while after somehow managing to write the first piece of code that actually acted as a Windows program. It used message boxes instead of proper windows to display the text, but at least it no longer did it in a simple Command Prompt window. It was still in D, as I got back to fooling around with that a little a few days ago.
But that didn’t last long, as I then tried to glance at the MSDN Windows programming tutorials and went straight from grinning like an idiot to feeling like one. I couldn’t understand the first thing about any of it, so gave up on all that right away. I thought that Windows programming was Windows programming, since you call on functions known by the operating system and not on those defined by the programming language you use, so if I could just find a proper reference to those functions I should be able to figure some things out, but the fact that pretty much any tutorial is written for C++ is far more of a problem than I thought it’d be. And D seems to have certain issues with Windows programming as well, the one I noticed right away being that it apparently doesn’t recognize the commands that require UTF-16, which are supposedly the proper ones to use ever since Windows 2000. If I look at the description of the issue on the official site, I can conclude that this is intentional, in an attempt to allow programmers to code applications that would work on older versions of Windows as well, but that makes an already awfully confusing thing even worse for me, since I don’t really know what all of that means.

But enough about that… Right now this is quite difficult to write anyway because I seem to be experiencing the exact same thing I have experienced all too many times back when I was little. I feel as if my heart will stop beating if I stand still. Or I felt like that, at least, since I seem to have managed to solve the immediate problem for the moment, after struggling with it for at least some 30 minutes. I’m not fully over it at the moment, I’m still very edgy and my arms and legs are frozen, but the need to get up and move around is under control and I no longer feel that something very bad is imminent, though something still feels out of place in my chest.
I just remembered that all that was required in order to snap me out of this when I was little was for someone to succeed in calming me down, to convince me that my heart is actually quite fine. At the time, that required dad taking me to a doctor, who’d listen to my heart, say that it is indeed obvious that I’m very frightened, but that otherwise it sounds as well as the heart of any person who’s in such a state can sound, then give me a mild over-the-counter sedative and sit and talk to me for some 30 minutes. This happened about once every two weeks or so, and sometimes I’d be pacing around the house for several hours without stopping before dad would come home and take me to a doctor.
Now, of course, I knew I had to sort it out myself, so started working on it as soon as I pushed the initial panic aside. (Interestingly, the first thing I thought of was “I’m going to die and I didn’t even post anything this week”.) I know that, likely due to living in constant fear for all those years when my parents still forced me to go to school, I have a certain arrhythmia for a very long time, which likely caused these issues back when I was a kid as well. Since it can sometimes even happen several times per day, I stopped having much of a reaction to feeling that something’s wrong for one moment a long time ago, though I will at least shift my position a little in response to the momentary adrenaline rush produced by my body in order to set things back in order. However, sometimes that moment can stretch on to several seconds, which makes for quite a major adrenaline rush and a good reason to be afraid.
I assumed that what happened was that one such moment caught me by surprise, just as I was starting to type this post, and that the adrenaline rush made me feel afraid, which in turn caused slight variations in my heart rate even after the initial issue was solved, which then caused even more adrenaline to be produced and so on. At first I tried to simply will myself to stand still and calm down, but that wouldn’t work for more than a few seconds, so I moved on to holding a hand on my chest to feel my heart beating and, while trying to think of other things or, failing that, to count slowly to 100, I made note of when my hand felt irregularities and compared that to when the rest of my body felt like my heart was going to stop, noticing that such moments rarely coincided. It still apparently took some time to actually convince myself of what I was noticing, but eventually in worked, so here I am now, sitting down and writing this for over 30 minutes.
Then again, I know the arrhythmia keeps getting worse, likely due to the mood I’m in ever since Andra left, so it may not just be something caused by irrational fears. But that’s not exactly what I should be thinking about right now, is it?

Back to the original topic of this post, I have to say that I’m starting to feel that D may not be the right programming language for what I have in mind. I mean, for example, if I see it said that the proper command for a message box is MessageBoxW, because a newer operating system will convert whatever it receives as MessageBoxA to UTF-16 anyway and therefore make the program run slower, but if I type that in D the compiler says the command is unrecognized and suggests only MessageBoxA, I can see a real problem when it comes to writing pretty much any Windows program at all. Sure, the older commands work as well, but why make your program run slower if you have no intention of making it compatible with old versions of Windows anyway?
But there are plenty of things I like about it as well, mainly the fact that it did take a fair number of things from scripting languages without being one itself. And I certainly have no intention of ever starting to learn C++, so that’s out of the question. But if anyone has any other suggestion of an active programming language that can be used to write proper Windows programs, go ahead and post a comment. Same if you can point me to a really good resource for learning proper Windows programming that could be used with D, without requiring or imparting any knowledge of C++.

0 Comments

No comments

RSS feed Comments | TrackBack URI

Write Comment

Note: Any comments that are not in English will be immediately deleted.

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>