The WFS Story

| | Comments (9)

I started working for REAL Software over four years ago (wow, long while ago now!). Back then, I used to get asked questions about how to accomplish things in Windows all the time. At least once a week I'd get questions like "how do I make it so that only one instance of my app runs?" and "How do I get the amount of free disk space?", all on Windows. There was a Carbon Declare Library (still is one, in fact) that helped the Mac users out. But there was nothing on Windows -- you were at the mercy of MSDN and declares.

Thus the WFS was born. I decided that as I answered customer questions about how to do something on Windows, I would add it to this uber-project. So that way, when I got asked the question again, I already had a project to hand them that solved the issue. It was pure self-preservation and laziness.

One day, I realized that it might be a good idea to give this project away. Then I wouldn't get the emails anymore since people could just download the project themselves. So I made a small spot on my personal homepage for it and dubbed it the "Win32 Declare Library." There are vestiges of the original name still in the product -- the main module is still tagged Win32DeclareLibrary.

The project started out as only a single module with a list of supported APIs. But, then it started to take on a life of its own. People would contribute things to add to the project, and I was constantly adding new support to it. Finally, I realized that this wasn't so much a declare library as it was a suite of functionality. The Carbon Declare Library is simply a wrapper around the OS APIs, and that's how the WFS started as well. But it quickly became a set of entire APIs -- not just wrappers. For instance, the StatusBar class was a full-fledged class -- not just a wrapper around StatusBar APIs that the user would have to implement. So after less than a year of living as the Win32 Declare Library, it was renamed to the Windows Functionality Suite.

Production continued at a steady pace from then on, and now the suite has grown to massive proportions. Version 2.3 is over 1.8 MB worth of code! With this growth comes problems. The two largest issues that have sprung up are: documentation and ease of use.

I had originally wrote sparse documentation for the flat APIs that explained how to use it and what it did. But it's tough to keep up on the docs, and most code submissions didn't come with any docs either. So the docs have really fallen by the wayside. I'm still hoping for a knight in shining armour to swing in and write a lot of quality documentation for the product, but I'm not holding my breath. ;-) I had tried my hand at making a wiki for the WFS, but that never took off either.

But the second problem (ease of use) is one that I take very seriously. When someone can't even "install" the WFS or figure out how to use it, then it's going to be a major source of frustration for them. It probably sounds like a holy grail of awesome Windows stuff, but it's just out of reach. Yikes! So the next release of the WFS goes a long ways towards making it easier to use and install. I've split the project into multiple templates (such as UIExtras, SystemInformation, etc) that can be installed in the IDE templates directory. I plan on making an installer which will locate the proper directory (make it if needed) and install the files into that location. This should improve the user experience of the WFS by a great deal (I hope).

So that's the story of the WFS, with a hint of the future to come. Any questions? Suggestions?

9 Comments

It's a great resource: whenever I need to do something in Windows that I don't know about, the first place I check is the WFS. I think you could either start a Wiki for the docs (did you not already do that?) or put it on sourceforge and make contributors check-in and out the docs when things are changed. In any case, updating the documentation is a smaller job for each release, so it's really a case of getting the existing docs up-to-date.

I think someone should take the Carbon DL, the WFS and the Linux one (if it exists) and compile a functionality suite that has a bunch of x-platform stuff, mac stuff and linux stuff. For example, I took your statusbar and added generic functionality to make it work as a standard statictext on other platforms, while keeping the API completely intact. A documentation wiki or custom database system would then be more worthwhile.

Well, I think I would separate things into a declares library, and wrapper classes to make them a lot less painful to use (like the StatusItem class). That way, if I don't like your wrapper, a lot of work is still done for me.

Also, I find the code very difficult to read through -- magic numbers, memoryblocks for things that should be structures (yea, I know this was before they existed), etc.

Put everything in the WFS sample project in one self-contained folder. Now that we can copy-paste folders it would be nice to 'install' the WFS in two keystrokes.

@SirG3 -- if you see magic numbers, then by all means replace them with their proper constants. I'm usually pretty good about using constants instead of magic numbers. As for structures, we'll just have to see.

@Adam -- the trouble is that a *lot* of people think it's a plugin and not a project. By making it into a template and having an installer, there's no question anymore. It shows up automatically when they go to make a new project.

As a matter of interest, how will the installer decide where to put the template?
If from the registry, will it be affected by the last copy of RB I used?

@Steve -- The registry isn't a bad idea (since that will usually pick the proper IDE), but I was thinking of auto-discovering the install directory, with an option to let the user pick the RB install directory.

I'm coming late to this post but I don't see an IDE template directory. Could you give me some insight into this?? Due to $$$ issues I'm still mired at 05r4 so if this is a newer feature then just disregard my query.

~joe

Hi All
coming in the latest, I have been using WFS for what seems like ages. I understand none of it but could not do half of my "cool" things without it. I listen to what aaron says and find what I need then cut and paste the pieces together so that I get one method which will do what I want. Case : KILLTASK which will end the process of any running task result=killtask("excel.exe") will kill excel. For those who dont know excel does not QUIT in RB2005 or RB2006 so I kill it manually. It is a pain to go through the WFS to find things but at the end of the day I find what it is that I need and then delete parts that I know I dont need and what remains is what I do need and hopefully learn something along the way.
I have thanked aaron many times for the WFS as it must have taken many long hours to get it to such a level.
Not sure what the point of the post was now but it is early here in Australia.
Thanks
Damon

@Joe -- it's a directory that you can create yourself. If you name it "Project Templates" and place it next to the IDE, then any valid project inside that folder is considered a template. Then, when you go to make a new project in the IDE, it'll be listed in that dialog.

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.