August 2005 Archives

The money-grubbing oil companies just raised prices today. $3.19 here in St Cloud. Their thought process: we lost some rigs in the hurricane so there's less oil being produced. Well that's peachy, but let's do some math. The way I figure it: $2.69 yesterday. $3.19 today. That's a jump of 118% in one day. How many rigs were lost again? Price gouging liars -- personally, I hope they rot. However, on a happier note, now that I work from home, I save all that money by not having to commute. So I should be thankful that the oil companies aren't

More Threads Explained

| | Comments (14)
Due to the number of questions I've gotten from people on the topic, I'm going to spend some time delving into this topic. Let's start off by familiarizing ourselves with the structure of the Thread class. It has four properties, two of which are new to RB 2005, it has four methods, three of which are new to RB 2005, and finally, it has a single event. Properties Priority as Integer This is one of the new RB 2005 features which allows you to control a thread's priority relative to the other threads in the application. The first thing to
Quite often I see people making programming mistakes that will cost them dearly in the long run. They'll do things like use App.DoEvents to keep UI updating properly, or they'll make their program inaccessible by leaving tight loops run with no way to cancel them. These situations are perfect examples of when you should be using a thread. Before we get to code, I'm going to explain a bit more about how threads work under the hood. A thread is nothing terribly special or magical. It's simply a way to slice program execution into discrete bits. I'm going to speak

Finally, an update!

| | Comments (3)
I'm back from my week-long vacation this morning. Didja miss me? :-P Lis came up on Friday; her flight was only about 4 hrs late, which isn't bad considering that Northwest was in the process of going on strike that day (MSP is the major NWA hub, so Lis was on Northwest). Sat morning we hung around St Cloud. It was gorgeous outside, so we went for a bike ride on the Beaver Lake Trails and wandered around SCSU for a while. Then on Sunday we went down to Ren Fest for the day. The weather was nice, but for
If you recall from last time, I showed you the in-memory layout of a COM object. It looked like this: ClassPtr->vTable->QueryInterface ...AddRef Release ... I had asked you if you could think of a way to emulate this in REALbasic. If you had said "with MemoryBlocks, Modules and the AddressOf operator", then you were absolutely correct. The ClassPtr is the COM object itself. It's simply a MemoryBlock whose first four bytes points to a vTable of interface functions. Since the caller has already defined the order of the functions, you're able to take advantage of this and lay the function
I'm going to take a brief break from the ContainerControl discussion to talk about an interesting hack I discovered. Don't worry, we'll get back to the ContainerControl series soon enough. So I decided to delve a little deeper into the mysteries of COM. It always bothers me when I can do something from another language, but cannot do it in any way, shape or form from REALbasic. And our support for generic COM is almost non-existent. We've got good support for ActiveX controls (which is a form of COM), but I wanted the nity-grity generic COM support. So the problem
I spent my first night in the new house last night. I got over there about 4pm with a load of stuff, just before it started to rain out. I ended up vacuuming the entire upstairs, mopping the kitchen floor twice, dusting all the kitchen cabinets, then cleaning the inside of them as well. I got my stove moved into place (it fits!! I was a little worried for a while -- there's only about 1/16th of an inch to spare) and even washed a few windows. Phew! After all the cleaning was done, I started getting the kitchen set
I was having a discussion with a friend of mine over the course of the last few days about the new house. It went something like this: "The new house is now feature complete! I'm thinking of having a release party." "I plan on starting work on House v2.0 this winter. The major new feature being the basement." "Woohoo! I've implemented garbage collection. It starts next Wed." "Yeah, there are still some minor upgrades to make like the bookcase in the kitchen. And there are some patches I still need to apply, like the nail-pop in the bathroom." Oh man,
Someone reported on the lists recently that the ComboBox doesn't autocomplete on Windows. I thought, "well hey, there must be some sort of standard control for this." And so the search began. At first, I hacked in a quick and dirty solution where I'd capture the WM_KEYDOWN messages (before we translated them via the TranslateMessage call in the event pump). Capturing this message would let me search the combo box for matching strings using the CB_FINDSTRING and CB_SELECTSTRING messages. If there was a match, it would automatically select it as the text. Well, this was really annoying. Let's say you

It's a house!!!

| | Comments (4)
Yesterday afternoon, I got a call from the appraiser asking me if I'd like to meet her out at the house around 5pm. I said sure, but warned her that the doors wouldn't be on yet because I was planning on doing them that night. She said she was sure it'd be fine. Well, we walked through the house and at the end she told me the house was one of the most finished-off ones she's walked. Usually she has to walk them while there are still subs actively working! LoL, so I put in all that extra work this
Last time we began to design a ContainerControl so that we can automatically handle the platform differences (between Mac and Windows/Linux) with an OK and Cancel button's placement on a window. If you haven't read the last article, you should go back now and read it before continuing on. Today we're going to begin implementing our design specifications for the control. If you'll recall, we need to implement the following: On Windows and Linux using KDE, OK should be on the left, Cancel should be on the right. On the Mac and Linux using Gnome, OK should be on the

Change Is Needed

| | Comments (33)
So for a long time, I've been quite active on realgurus. However, I think I need a change of scenery. After being called a "Windows whore" and just the general childish bitchiness of many people over there, I need a break from it. I'm not required to talk to *anyone* outside of REAL Software -- and I pretty well despise being treated like shit with the expectation that it's my job to take it. It amazes me that someone can bitch at me about how my company treats all customers horribly and we're all terrible people, and then a day
Last time, I started to get into why ContainerControls are useful and hinted at designing a class from scratch that you can drop into your own projects. Today we'll begin to design this class. Before we begin, let's talk about what sort of functionality we expect from the project. The problem is that OK/Cancel button orders are different on Mac than they are on Windows and Linux. So we want to design a class that abstracts this information so you can focus on the purpose of the interface, not the esoteric platform-specific details. The things our class should automatically do
Today, I'm going to start to delve into a new RB 2005 feature -- ContainerControls. Before I continue, I would like to note that the ContainerControl is a Pro-only feature. However, you can still play along even if you don't have RB2005 Pro -- your apps will be built as a demo though. Let's start off with a bit of a (recent) history lesson so that you can understand the background of the feature. A ContainerControl is really a cross between a Canvas and a Window. It's like a Canvas in that it's a single control that can be used

The Weekend So Far

| | Comments (5)
I got up and out to the house at 7:30 am this morning, and just got home now (5pm). Dad and I went out there to get as much of the little putz-work done as we could. And boy, we did get a lot accomplished! 1) Cleaned the garage so it looks good -- not like a tornado zone. 2) Cleaned the entire basement. I pulled out 6 full dustpan loads of crap from the floors, and filled the (huge) shop-vac almost 1/3 full -- that's just how much sand, sawdust and other gunk there was in the basement. It

What's New

| | Comments (4)
All sorts of things are happening lately, so here's my little status update. They came out and put the final grade on the lawn today. We may have a problem with getting the slope right though, so I've had a few..erm... strong... discussions with people about it. It better be fixed. The people putting in my driveway (Universal) have done absolutely nothing. So they're about to find out that I have a size 13 boot which I don't mind shoving up people's ass when they only do half a job. Not that I'm angry or anything. ;-) My carpet will

What do I think of IE 7?

| | Comments (4)
Slow. The thing is a total dog when it comes time to render a page. My own piddly little website takes a long while to fully view because there's a dramatic pause between host resolution and the start of rendering. Bleh! Ugly. The new interface to it is horrible. I'm sorry, but the menu belongs at the top of the window, not below some toolbars. The UI constantly monkeys with my expectations of whether UI elements are to be located. My muscle memory hates you IE 7. Hates. You. Rendermonkey. It has a harder time rendering pages than IE 6,

What is Managed Code?

| | Comments (9)
The other day, someone posted a comment asking what managed code was. This is an attempt at explaining it. Although some .NET people will claim otherwise, it's basically just a fancy marketing term for interpreted bytecode that is run by a virtual machine. Yup, Java's been using "managed code" for ages folks. It's really not a new concept. When you create a .NET application and compile it, what really happens is that your source code is compiled down into IL (intermediate language) assembly language. Then the IL code is wrapped inside of a PE32 executable file. This PE32 file's entrypoint

Vista Screen Shots

| | Comments (5)
Note -- you can click on each picture for a larger version of it. I use a 1600x1200 resolution, so the screen shots are rather large. This picture just shows a few Explorer windows as well as Trillian running. I changed my desktop background to something other than the grass, but it's another stock image. This shot shows RB 2005r2 running in Vista. And not that I don't trust you guys, but I blocked out the screen names of coworkers just in case. :-P In case you're wondering what project that is -- it's our regression test suite. Now you
Installation Monday, August 08, 2005 9:25 AM The install went very smoothly, though it took a long time. The OS comes on a single DVD, and takes around an hour to install. However, it's almost fully automated. I had to enter in a license key and a computer name to get the OS to install (instead of the old Windows installers which used to ask you questions at various times during the install). Boot time (from loader to usable desktop): 54 seconds on my 1.6 GHz, 768 MB of RAM machine. The OS incorrectly guessed that I was in the

Re: More User Input #3

| | Comments (9)
Scott P mentioned, "To get a 10pt font in RB (in Windows) you have to choose 12pt! And in the Options dialog, the font previews show even smaller than that!” RB's font support is a history lesson waiting to happen. Well, wait no more for your lesson. ;-) Fonts in REALbasic all make the same assumption -- you're working with a 72 DPI machine. This is because that's the default DPI for a Mac. So when you specify a 12 pt font on the Mac, you get a 12 pt font at 72 DPI. Now, when you cross-compile to Windows

What's Up For the Week

| | Comments (9)
Monday: I'm taking an educational day on Monday so that I can check out Windows Vista and report back all my thoughts on the latest OS to come out of Redmond. It should be a really fun day. I've got the OS installed (did it last night), but I'm refusing to play around with it until tomorrow so that I can write my thoughts up as I experience them. I also have to bring Pixel into the vet tomorrow over my lunch. Time for her check-up! I'm going to be calling my driveway contractor to find out why I still
So I borrowed Adam's DVD burner so I could burn a few things to DVD -- one of those things being a backup of my dev box so that I could reformat it. So I got the DVD burner hooked up (to the Mac), started it on burning Windows Vista and MSDN July 2005... then reformatted the PC. :: knocks head into desk :: I didn't transfer my backup folder to the Mac before doing my reformat. So I lost my email, a bunch of desktop wallpapers, a few dozen RB projects (including the WFS 2.2, with some new features

Worst. API. Ever.

| | Comments (0)
So I was a bit surprised the other day when I was reading Raymond's blog because he usually never has magic numbers in his example code. But he was doing GDI operations, like BitBlt, to demonstrate how to draw a masked menu graphic image. So I was a bit curious where he got these magic numbers from, so I followed the link he posted to the raster operation codes page over at MSDN. I must say, this is the worst designed API I've ever seen. It may be nice from the API designers point of view, and I can see

What do I hate today?

| | Comments (4)
In order of blind, illogical hatred... DVD manufacturers and their insipient need to make multiple freaking formats. Target, for only having DVD+Rs on display, which is what I purchased. Apple, for having a DVD-R burner in their iMacs. Myself, for not noticing this very subtle packaging difference. Thankfully, I have friends like Adam, who have burners that can use +Rs. So I'm going to dump my +Rs on him and he's going to give me some -Rs and then I can be happy again. Yay for Adam!
One question which I've seen asked, but I don't think is covered very well by the documentation is what the different frame types are for a Window object, and how they map from platform to platform. So let's take a look at what each of the frame types look like on all three platforms. 0 - Document This is, by far, the most common frame type in application. It's the default frame type which should be used when you want a modeless interface that has a titlebar and shows up in things like the taskbar. You'll notice a few things

Getting Very Close

| | Comments (5)
So the house is getting very close to being completed, and I'm getting excited. My carpet didn't get installed this weekend because it was damaged. So I've got a new roll of it coming to the house, and it should be out at the house relatively soon (sometime this week I'm hoping). Dad and I went out and started hauling appliances upstairs and into the kitchen. My fridge and dishwasher are up there and all set to go. But the stove was damaged (which I didn't notice until I got it out of the box), so I had to get
I'm talking about Windows here, so if you're expecting to see me gripe about the Mac, you're in the wrong spot. ;-) 1) I never know what I'm searching with the search field. It's always the same magnifying glass icon, regardless of scope. To make matters worse, when I click (for click I must, there's no keyboard shortcut to drop the list down), the menu doesn't show any items checked. Ever. Blarg! 2) We use popup arrows everywhere! These little UI abominations should have died a firey death with Classic. There are two standard controls we should be using in

Re: More User Input #2

| | Comments (9)
Dank asked, "Why does RB save code in a proprietary format instead of nice portable reusable easy-to-work-with text files?" Excellent question! We use a proprietary file format so that we can add all sorts of good metadata to your code. Things like breakpoint positions are stored with each source line in your project. This way, you can take your project and give it to another person, and they get the exact same settings for it. Using a binary format also lets us store other sorts of information such as line by line revisions for a version control system, and things
Ok, I haven't had a good rant in a while. So this should be fun. QuickTime for Windows is a crock, and it's only gotten worse as time goes on. I just heard on the lists that installing QT7 completely breaks RB, so I downloaded it to see if I could track this down. That's how this whole rant got started. Here's my thoughts: 1) It breaks software that's been working since the first release of QT on Windows. Bad Apple! But ya know what, it happens, and I can live with that. I (or someone else) will find the

Blogroll

Friends
REALbasic Related
Win32 Programming

Disclaimer

I'm currently an employee of REAL Software. My blog is mine. The opinions represented in this blog are mine as well and may not represent my employer's opinions. All original material is copyrighted and property of the author.

REALbasic® is a registered trademark of REAL Software, Inc. REAL SQL Server™ and Lingua™ are pending trademarks of REAL Software, Inc. All rights reserved.