What’s Up with Sedna?


According to Milind Lele, we should be seeing a beta of Visual FoxPro 9.0 SP2 and Sedna in the next month. Given that the May “Letter from the Editor” wasn’t released until the very beginning of June, I’m guessing that they’ll be released towards the end of June or the beginning of July. I guess I could just ask Milind when the release is scheduled for, but that would take all of the fun out of it and they may not have a firm date set anyways. Truth be told, I like wondering if “today’s the day” just as much as some of the rest of you do.


As most of you know, I am contracting for Microsoft presently and working on the “Vista Toolkit” portion of Sedna. The following are a few of the things that are currently being considered for inclusion in the beta:


Windows Desktop Search (WDS)


Microsoft pretty well deprecated most of the stuff I had previously done for this. That’s one of the problems with being first-out-of-the-gate, they can always decide to change their minds. The bad news is that in so doing Microsoft took away some of the functionality we had access to before (not just for Visual FoxPro developers – this affected everyone). The good news is that instead of using a custom assembly, developers can now access WDS via an OLEDB Provider. This makes the task much easier and even more natural for Visual FoxPro developers.


Windows RSS Platform (MSFeeds)


The Vista Toolkit project relating to MSFeeds is a Visual FoxPro class library that contains classes wrapping nearly all of the classes and functionality provided by Windows RSS Platform. An RSS reader was even built to serve as an example of how to use this library in Visual FoxPro. For those of you that haven’t seen it, you can see a previous blog post of mine regarding Sedna.


Windows Vista: Dialogs


One of the things that is important to a significant portion of the Visual FoxPro community is making sure that their applications don’t look dated or shabby when compared with the applications created by other development tools. Now, some developers are just piss poor when it comes to creating professional looking interfaces regardless of the tool’s abilities (You know who you are with your techno-colored screens, Windows 95 graphics, a hundred different font styles and a penchant for never visually balancing or lining up anything.), but for the rest of the artistic, Windows Guideline conscious developers out there, being able to give an application an up-to-date look and feel is important. Sometimes perception truly is everything, so in the interest of that a .NET assembly has been created that provides the ability for Visual FoxPro developers to use the updated Vista dialogs when creating applications for Microsoft’s newest operating system.


Now, some of you may be thinking surely Microsoft updated the GetFile(), GetFont(), GetPrinter(), PutFile(), and Sys(1037)functions to use the newer dialogs and created a TaskDialog() function similar to Messagebox(), right? No. That was part of my job, and I had to find a way of doing it that was external to the Visual FoxPro core and I couldn’t use an FLL either (I tried, believe me I tried). The previously mentioned functions use the older-style dialogs and continue to work thanks to the backwards compatibility of Vista, but they look a little dated (even with the updated Windows icons in Vista). A few screen shots may better illustrate the point…


Vista’s Open Dialog vs the GetFile() Dialog


Vista’s Save Dialog vs the PutFile() Dialog


Vista’s TaskDialog vs the Messagebox() Dialog


Using these new dialogs is fairly straight-forward unless you are allergic to OOP. For instance the code to create a TaskDialog will probably look a little something like this…


m.oTaskDialog = CREATEOBJECT(“VistaDialogs4COM.TaskDialog”)
m.oTaskDialogEventHandler = NEWOBJECT(“TaskDialogEventHandler”)
EVENTHANDLER(m.oTaskDialog,m.oTaskDialogEventHandler)
WITH m.oTaskDialog
    .Content = “Here is some content.”
    .Caption = “Visual FoxPro Rocks!”
    .Instruction = “Download Sedna”
    .MainIcon = TDSHIELDICON
    .StandardButtons = TDYESNOCANCEL
    m.oResult = .Show()
ENDWITH


To create an Open File dialog it would be something like this…


LOCAL ARRAY laFiles(1)
m.aFiles(1) = “”
m.oOpenFile = CREATEOBJECT(“VistaDialogs4COM.CommonOpenFileDialog”)
m.oOpenFile.Title = .text3.value
IF !m.oOpenFile.ShowDialog()
    m.aFiles = m.oOpenFile.FileNames
ENDIF


To create a Save File dialog it would be something like this…


m.oSaveFile = CREATEOBJECT(“VistaDialogs4COM.CommonSaveFileDialog”)
m.oSaveFile.Title = “Save File”
IF !m.oSaveFile.ShowDialog()
    m.cFile = m.oSaveFile.FileName
ENDIF


That’s basically how it would work. What I’m not showing here is the immense number of other properties you can set, functions you can use, and objects you can access with these dialogs. I’ve created these dialog classes in such a way that Visual FoxPro developers will be able to add controls to them. Microsoft and I strove to give Visual FoxPro most, if not all, of the new functionality of these Vista dialogs provided, and once you get your hands on the assembly that makes this possible hopefully you’ll agree.


The other thing to mention here is, as with other portions of Sedna, these class wrappers, assemblies, and coded examples can be used as a guide for Visual FoxPro developers to implement just about anything in Visual FoxPro and .NET to provide additional functionality external to the core of Visual FoxPro. As mentioned in the announcement, the source code provided as part of Sedna is slated to be posted somewhere on CodePlex.


More on Visual FoxPro and Vista


If you want to learn more about how you and your company can create Visual FoxPro applications with an eye towards Vista, then you might want to attend Southwest Fox this coming October where Doug Hennig will be doing a session called “Developing Visual FoxPro Applications for Windows Vista“. Along with Rick Schummer, Doug Hennig is another one of the developers that helped work on Sedna. So if you’re interested in what is possible for Visual FoxPro and what might be coming up, Southwest Fox is probably the place to be this October. In addition, every attendee will get a copy of the entire Visual FoxPro codebase that I stole off of Microsoft’s servers. OK, that last sentence isn’t true, but I liked the way it sounded so much that I couldn’t help myself. I may now be an ex-contractor for Microsoft. Anyone got any projects they need help with?


Until next time, Visual FoxPro Rocks!