Vista has some awesome APIs

| | Comments (4)

Windows Vista has got some truly awesome APIs in it. I was checking out the Recovery Manager functionality, and am looking forward to adding it to the WFS in the near future.

The Recovery Manager allows you to register your application to allow it to recover from disasters. For instance, you can register a callback which is called when your application crashes, allowing you to attempt to recover your data. So, let's say this was added to REALbasic. What would happen is that we'd be given a chance to save all of your unsaved changes before terminating the application.

Another neat API is the ability to register your application for restart. This way, if your app crashes, you can have it automatically restarted by the Recovery Manager as well. Couple this with the data recovery mechanism, and you've got some real power over the user experience. Picking on REALbasic again -- if your IDE session crashes, we would save all the data in the recovery callback, optionally allow you to send a crash report to RS (since we would, hypothetically, have the opportunity to find out WHY it crashed), and then restart your session where you left off; recovering all of your unsaved changes.

The mechanisms for doing this are all quite simple. You register a recovery callback which is automatically called for you. From that callback, you have to let the manager know that you're still doing some work (because, it could be that your callback is crashed as well, in which case the OS still needs to do more work). Then, when you're done recovering, you tell the manager you're finished. Easy as that!

4 Comments

What about improvements in crash report content? On Mac OS X, crash logs are easily traceable and useful, but on Windows, I've never been able to use a crash log with REALbasic-made apps to solve a bug.

Does Windows even have the concept of "symbols" used in crash logs? Is this likely to come about in the near future?

So, does this saved stuff get saved into a separate file, or does it overwrite the previous one? I guess it'll be the former, but since you didn't write it here, I just thought I'd mention here that whatever data you save close to a crash is potentially invalid (might have been screwed up and thus caused the crash). If you just save that into the same file, you could effectively be trashing the user's last "backup" (that's only missing the last session's work) in an attempt to give them the last session. :-(

@Adam -- Windows has symbols (the symbols come from the compiler and have very little to do with the OS), but their crash logs aren't as human-readable as on OS X.

@Uli -- that data would certainly go into a separate file, for exactly the reasons you gave.

Leave a comment

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.