So I came to a strange realization last night. I've been working for REAL Software for half of a decade now. It's kind of hard to believe that it's been five years already! I certainly don't feel five years older, but when I look at what I've accomplished, it's hard to imagine it's only been five years. Personal: 1) I met Elissa, dated her and got engaged to her. Whoa. 2) I built my own house from the ground up. 3) I found Pixel and became a cat person. Now I have two cats (Miikka counts as mine too). 4)
March 2007 Archives
So I finally got 2.5 out the door! Wahoo! You can grab it here: http://www.aaronballman.com/programming/REALbasic/Win32FunctionalitySuite.php There's a ton of new stuff for the various Vista APIs (but obviously, not nearly as much as there could be). Additionally, there are a lot of bug fixes for things. I'd like to thank everyone for pointing out ways I can improve the suite. If you plan on getting REALbasic 2007r2, you will want to upgrade to the WFS 2.5 because there are a few newly reserved keywords in REALbasic which I was using in pre-2.5 (the keyword Global comes to mind). Enjoy!
Someone forwarded some C code to me recently that they needed to have converted to REALbasic. The idea was that they had a file on disk which they wanted to programmatically change the access rights to. Here's what I eventually came up with: dim aMode as Integer = &h2 dim aAccess as ExplicitAccess dim aPath as String = DesktopFolder.Child( "Test" ).AbsolutePath dim aTrustee as String = "VistaPC\Elissa" dim aOldACL, aNewACL, aPSD as Integer dim aErr as UInt32 dim aMask as UInt32 = &h1 + &h2 + &h4 + &h8 + &h10 + &h20 + &h80 + &h100 Soft Declare Function
I thought I turned old last year.. this year was even worse. I turned "older!" (28, for those of you keeping track at home.) I've had a super busy week which is why I've been lax in putting up meaningful blog postings. The basement is almost finished, which is super exciting to me. And I've helped some friends get all moved into a house down the street. And then the whole birthday weekend thing snuck up on me. Lis and I went up to Alexandria yesterday to go see the "sights." Of course, it was a rainy Sunday in rural
Every once in a while, I run into someone using code like the following: Sub SomeMethod( foo as Integer ) if foo = 12 then Quit Exception err as RuntimeException MsgBox "Exception happened" End Sub Did you spot the bug? Hint, it's in the title of the blog post. ;-) The problem with this code is that it's using a catch-all exception handler. Personally, I think this is an abuse of the exception system and should be avoided out of principle. But that issue aside, the trouble with this code is that it's also going to catch "internal" exceptions like
I know the answer to that already, so don't bother. ;-) I was thinking about my rather eclectic mix of movies I enjoy and realized something. Lis and I can't agree on movies. Ever. Trips to Blockbusters are really painful because we have such drastically different tastes. Thankfully we have similar tastes in music. I've been rather enjoying her Regina Spektor CD lately. Sorry about the lack of good posts lately, but as usual, life has been kicking my ass. I've been working very hard on various RBLibrary ventures, as well as trying to work on the basement while helping
I'm trying to package up a new version of the WFS in the coming weeks. While it already has some amazing new APIs for much of the new Vista technology, I'm always keen on adding as much value as possible. So I'm wondering if anyone has any submissions they'd like to add to the WFS. You can email me about it at aaron@aaronballman.com. What's more, if there's something missing from the WFS that you'd like to see added but (can't | don't want to) add yourself, please email me as well. Thanks!
So I'm looking to make a fairly comprehensive REALbasic related blogroll, and I need your help. I've got a good start (about a half-dozen or so entries), but I want to pick up the ones I've missed. The criteria for entries are: 1) Must post information about how to do things in REALbasic with some amount of regularity. Even if it's only once every few weeks or so. (And by "information", I mean factual things -- not just "I love REALbasic because it's green" or "I hate REALbasic because it makes me blue.") So it doesn't have to be entirely
So here's another neat entry for your Win32 API toolbox: application recovery services. Starting with Vista, you can register with the OS to have your application automatically restarted during various crashing situations. What's more, you get the chance to recover data when the application does crash. It's trivial to implement into your own applications, so I'd highly recommend it. The basic idea is this: when the application starts up, you register a callback which the OS can call when the application crashes. This callback's job is to attempt to recover data from the app which has crashed. Remember -- your
Friday night was rather exciting -- Lis made me watch Brokeback Mountain. It was a pretty good movie except for some rather awkward moments. I'm comfortable with my sexuality and have several gay friends, but apparently I'm rather shy when it comes to watching guy-on-guy action with my fiance. :-P That being said, I'd still recommend the movie to people who have open minds. In any event, I stayed up way too late on Friday, so Saturday came pretty darned early. But Lis and I ended up spending it mostly hanging around the house. She had to run out for
While working on a particular project of interest to me, I happened to need a few functions which I was rather surprised don't exist on the BinaryStream class: ReadCString and ReadWString. I'm not certain why they don't exist on the BinaryStream already --- I mean, there's a ReadPString on there! So I wrote some handy little extension methods that you're welcome to use. Function ReadWString(extends bs as BinaryStream) As String // Read one word at a time until we come to a 0-word. dim ret as String dim word as UInt16 do word = bs.ReadUInt16 ret = ret + Encodings.UTF16.Chr(
So I spent the last day or so writing a handy little utility which takes a PE32 executable file and ravishes it, looking for resources. Basically, it just spits the resources out into a tree view control so that you can look at the resources for any executable file. I'm doing this so that I can learn more about the way resources are stored in a PE32 file for an idea that I recently had. I must admit, the code for this project went a lot faster than I anticipated. Granted, I had a general understanding of how PE32 is
So I ran across two interesting language foibles today. Both of them are easy to work around, and I haven't determined whether they're really even bugs or not. 1) Variant can't hold Ptr. Which means a Dictionary can't hold a Ptr. The only way to do it is to cast as an Int32 on the way in and out. I suspect that this is just a simple oversight. 2) RaiseEvent cannot work with qualified names (such as Foo.Bar). This is sensible -- otherwise you could do something like RaiseEvent someSameClassInstanceVariable.SomeEvent. However, it does have a drawback: you can raise an
Let's say that your application has some functionality which requires administrative privileges to accomplish its task. For instance, you need to write some settings out to HKLM, or register some file types in HKCR. Well, in the "olden days" (read: any time before Vista), you could generally assume that the user was running with admin rights and could do this. Of course, your assumptions could be wrong plenty of the time too since millions of people run as standard users even in XP and Win2k. But in Vista, chances are pretty good (about 99%) that the user doesn't have sufficient