Wednesday, April 30, 2008

Kevin Ragsdale: In DLL Hell

Kevin Ragsdale's FoxPro Blog: DLL Hell Rears It's Ugly Head

Kevin reports on a problem that I've also been hit with (but was never able to track down properly - it just "went away").

The upgrade to VFP SP2 killed one of his apps - why? Invalid DLLs all over the place.

But Kevin notes some key items:

How To Avoid DLL Hell (not always sanctioned but it works and in this day, that's more important than most else)
I changed my installer to just dump the VFP 9 SP2 runtimes into the folder where the app is installed.

But as Kevin notes:

"Install VFP 9 Service Pack 2. Today. Stop reading this, and go try it out. Try it on a test machine. Try it on Virtual PC. Just try it! Quit whining about what it might do to your apps, and go see for yourself. You'll never know until you try."

Sad News: Ken Murphy

I just read through some MVP news as well as the posting on Foxite that Ken Murphy passed away.

If you aren't familiar with Ken, he was a regular community member on Foxite - it seemed that sometimes he was there 24 hours a day with how quickly he posted, and how he always encouraged everyone in the community to give back just as he has done.

He will be missed.

Foxite

Monday, April 28, 2008

VFP Help Updated - Some problems found

Rick had posted two weeks ago about how some VFP updates were coming down the Microsoft pipe. They were released recently but unfortunately, have some glitches.
Shedding Some Light - Comment

I typically use the VFP online help or rely on other sources but it might be nice if the entire help file could be "codeplexed". That way, the Fox team doesn't have to pull their resources from all over to get it done and community members could get it cleaned up.

Just a thought.  

Using My for Settings Management

Just about every FoxPro application has a need to store settings. Whether it be the startup folder or various application preferences, they have to be stored somewhere. Of course, that begs the question "where"?

Back in the DOS days, many developers stored settings directly in a DBF table. This sometimes created a table with one record and lots of fields which was immediately useless once you had more than 255 settings (many applications continue this tradition today).

When Windows started becoming popular, many started to follow the INI approach, creating settings like
[application]
suppresslogin = true
name = george

[timezone]

This approach is still used and has support in the FoxPro Foundation Classes (and in the Solution Samples).

Developers have also embraced the Windows Registry (especially with Win XP). It's very handy because you would easily separate out MACHINE level settings from USER specific settings.  Problem these days is that writing to the Registry is pretty much frowned upon with Vista unless you're running as an administrator (which may be fine for storing app generic settings but not so much for end-user settings).

So what's a developer to do?

I've been using a DBF for several applications (appropriately named SETTINGS) which works well but if you've started working with ASP.Net or other VS applications, you're likely becoming familiar with the whole ".config" file approach. These are essentially XML files that hold settings. Since it's XML, it's not completely understandable to an average user but the basics are in there and it can be edited in Notepad (or maybe better, XML Notepad)

Enter My.

My is one of the new VFP pieces from Sedna and it includes a handy Settings class for managing application Settings. There are only four methods so it's easy to start working with. The big benefit here is that it saves settings into an XML file that uses the same schema as DotNet, making it easier to let non-VFP admins or devs review the files.

Here are some quick samples:

My = NEWOBJECT("My","My.vcx","My.app") && If you've copied it over.
** Creating the initial settings file
My.Settings.Add("ApplicationFolder","C:\MyApp\")
My.Settings.Save("App.config") && or whatever file name you need to see

IF My.Settings.Load("App.config")
    IF NOT my.Settings.Exists("HelpFile")
       my.Settings.Add("HelpFile","HELPME.CHM")
       my.Settings.Save("App.config")
    ENDIF
ENDIF

Those are all the methods you have to be aware of: Add, Save, Load and Exists.

So how do you access a setting? It becomes a property of the My.Settings object.

lcFolder = My.Settings.ApplicationFolder

lcHelp = My.Settings.HelpFile

If you look in the actual file that is created by the Save method, it looks something like this:

<?xml version="1.0" encoding="utf-8">
<SettingsFile xmlns="" CurrentProfile="(Default)" GeneratedClassNameSpace="" GeneratedClassName="Settings">
<Profiles/>
<Settings>
<Setting Name="ApplicationFolder" Type="System.String" Scope="User">
<Value Profile="(Default)">C:\MyApp\</Value>
</Setting>
</Settings>
</SettingsFile>

As you can see, there's room for a little more growth in that file.

Benefits
1. The Add method handles different types of data elegantly. (note the Type="System.String" in the XML file)
2. Easy access via properties (although you have to use Exists if you need to verify that a setting actually does exist)
3. It's Extensible (more on this in a future post- but I know Doug Hennig has talked about this before as well)

Drawbacks
There are some little quirks that will hopefully be addressed with:
a) be sure not to put spaces into the setting value - it errors out
b) if you call Load and the file does not exist, it errors out so be sure to wrap it with a IF FILE() before you look for it.
c) you can't remove a setting without manually editing the settings file
d) you have to manually check to ensure a setting exists

So what?
Your existing applications may already have their own method for managing settings - and I certainly wouldn't want to start changing working applications.

But if you are rebuilding an application, need to start tracking settings, or working with other possible non-VFP users and want to make your settings file easier for them to understand, consider using the My.Settings.

It will get you started exploring the other benefits of the "My" namespace, will make it easier to manage settings, and provides an easy to learn approach for other developers as well.

Need to get My? Go to the VFPX CodePlex project or download Sedna.

Thursday, April 24, 2008

FolderShare : for Windows 2003 ....NOT!

I really want to use some of the new Windows Live services - really I do. But this just frustrates me.

The content on this page for Windows Live FolderShare beta
says
"Requires: Windows Vista, Windows XP, or Windows Server 2003"

Great - I install it on XP. No problem. I go to install it on my Windows Server 2003.

"Foldershare is not supported on this version of Windows."

Dumb.

GoogleDocs with VFP

Kevin Ragsdale has a great video showing how to integrate GoogleDocs with your VFP application. (and yes, he answers the question "Why would you want to do that?")

http://kevinragsdale.blogspot.com/2008/04/google-docs-with-visual-foxpro.html


Glad to see you back Kevin!  

Tuesday, April 22, 2008

Planet Fox: Tracking the worldwide world of FoxPro Developers

If you've never checked it out, you may want to look at Ted Roche's Planet Fox

It's a never-ending feed of posts from a huge list of FoxPro blogs and even though Ted doesn't do too much in the FoxPro arena, it's kept up to date really well.

If you don't use an RSS reader (what!?!?!), definitely a good page to bookmark.

Monday, April 21, 2008

Interesting reading on Burkhard's VFP 9.0 Blog

Don't know why I hadn't seen this before but Burkhard's VFP 9.0 Blog has a wealth of information on a variety of VFP development topics including Native controls, binary files and RTF2HTML.

Definitely worth checking out.

Thursday, April 17, 2008

New updates coming down the pipe for VFP9

Rick writes about some of the news from the Microsoft MVP Summit - that there are updates coming down the pipe for VFP 9: one more cosmetic (in my mind - documentation updates) and one more important (a bug fix for a reporting error).

Regardless of whether this addresses your favorite VFP 9 SP2 bug, this is good news all around - because it does show a willingness on the part of Microsoft (ok, who am I kidding here - on the part of Alan (yag), Calvin, Milind, Richard and some others) to work with the VFP community and its effort to continue VFP.

Woody commented in an earlier post about the possibility of lawsuits against MS for breaking existing apps. I don't think that will happen (while you can sue for your car having design flaws that kill, you can't sue for your car breaking down - of course, someone could prove me wrong here).

In my case, I'm still optimistic about some other fixes - seems like the MVP summit had a lot of good feedback going both ways...
   
Blogged with the Flock Browser

Automating Checkins and Builds with VFP and VSS

I use ProjectHooks a lot in my day to day VFP development - for a variety of things:

a) copying the completed APP into a test and/or deployment directory
b) ensuring version #s are consistent across our remote development team

But what I'm always missing is a way to ensure the latest code is always checked in.

We deal with a lot of remote programmers so it's really important that if I finish working on something that it gets checked in so if others have to work on it, they can grab it without worry.

What I have found is that I can call

_VFP.ActiveProject.Files(1).Checkin()

and it will pull up the VSS Check-in utility BUT there's one gotcha:

it only works if you have the Project Builder open.

If you simply issue a BUILD EXE xxx FROM xxx, it won't run. Now I suppose, I COULD do a MODIFY PROJECT _VFP.ActiveProject.Name before hand and then let it go but is that really necessary?

I could also force an update by manually calling the internal check-in commands but that's a kludge. Has anyone else ever come across this - What did you do for a solution?

How free goes viral:from Church of the Customervir

Caught this from mriffey over on Twitter .
How free goes viral: Church of the Customer Blog

The comments are interesting  - sure "free" is how shareware sometimes gets started but overall this is just a very neat little video to watch.
(kind of reminds me of the opening of Love Actually)

Sunday, April 13, 2008

Pirillo - Don’t Let Software Die

Don’t Let Software Die ~ Chris Pirillo

Interesting post regarding TuCow's decision a while back to stop updating Blogware. It reminded me a little of VFP in that it's a company that has decided to stop updating one of its software packages.

Chris' comments on the letter:
>> What worries me most about building communities on closed platforms is that as soon as those platforms change direction or stop innovating, you’re locked into a toolset that has nowhere to go but down

Whoa! Does this sound like VFP and FoxPro? Read on...

>> Tucows has given absolutely no indication that they’re interested in opening the platform at all - leaving you in more of a no-win situation.

You can't fault Microsoft for not wanting to open up the VFP engine - as that has given a lot of its other products some definite improvements but the re-licensing of the xBase components certainly does show that they were interested in not killing it outright. Indeed, I think Microsoft deserves some kudos for a lot of the openness they have shown recently (VSX, etc).

Before you criticize my "blind support", of course, it's for the good of their business. Why else would someone do anything? You want developers to be using the Visual Studio Shell, to make their development "home" beyond everything else. But it's great that they have opened it up to let others create their own environment within it.

>> My “continued support of Tucows” is completely contingent on what they decide to do with Blogware now… aside from abandoning it. Don’t let software die, please? If nobody wants to pick up the ball and run with it, at least you would have given them the opportunity to do so.

At a recent Microsoft event, I ran into some developers who offered the comment "When was your last version?" (or something to that effect). My response? "If you're waiting for Microsoft to be the only one to improve a product's offering, then you're in the wrong business". That isn't a slant against Microsoft - but rather against those who would say "well, it can't do it out of the box so therefore, I'll wait for it to do it INSIDE the box".

Microsoft has offered FoxPro developers this - "you can't have the rubber that makes up the ball, but here's the ball - run with it."

So when people ask what's the latest version of FoxPro, I simply say "VFPX". There has been and will always be more innovation inside a product's community than just what is inside a product vendor's corporation. And that is good for the entire community. If you ever get into a situation where the only people offering new features or uses for an (existing) product is the actual company making it,  be forewarned.

(note: I say existing because obviously that is very often the case for startup products)

The only thing we have to figure out is how to ensure people can continue to purchase VFP proper...can a third-party organization possibly get a "distribution license" for perpetuity?

Monday, April 07, 2008

VFP IMAGING : FoxCharts !!!

Hmmm---need charts in VFP?

Cesar shows you powerful charting from VFP - With no ActiveX controls, dlls, or 3rd party products

VFP IMAGING : FoxCharts !!!

Yes, it requires GDIPlusX from VFPX but what a great project.

Hey Cesar, put this into VFPX directly - this totally rocks!

Thursday, April 03, 2008

Funny UI Decisions

I've been reading KC almost since I started using an RSS (when I grabbed a bunch of the earliest MS bloggers and aggregated them) - and many of her posts are enlightening, some very informational (this is someone who has moved around MS quite a bit in different areas) and some just funny - like this one - KC on Exchange and Outlook : The power of words

I guess we don't call it user interface anymore but rather User eXperience but it's still the same - how do people interact with your product.

And as more resources get outsourced, this is an area where every developer/manager/user needs to be vigilant.

Just as Jay Leno has his 99 cent store where recently they were wishing people Merry Hristmas and Happy Biryday, the quality bar on what words you use in your application needs to be raised. Where else did I hear this?

Oh yeah, Jason Fried from 37 Signals in his SXSW session "What we've learned at 37 signals" - paraphrased: "before you do re-design, think about re-wording...words are cheap, you can make an entire interface simpler by changing or removing a few words...much easier than re-designing your application from scratch". (I swear I don't get royalties from plugging his session although I've done it here, in the FoxShow and just talking to people).

Wednesday, April 02, 2008

April Fool's and VFP

OK - I hope everyone had a blast yesterday with the various jokes that went around although I have to say I think Doug's hit a little too close to home.  Before I read his, I was even tempted to post one that said "Microsoft was giving up on Visual Basic and introducing a USE statement into Visual C#". But after seeing his (the clincher was the WSYP feature), I figured I would stay out of it.

I always think of the best April fool's jokes as having a few qualities:

1) Possible yet extremely unlikely
2) Ludicrous expectations (as in with Virgle)
3) Absolutely no way no how (as with the Google Flush for WiFi)

Even Craig Bailey's old one (that wasn't posted on April 1) did make me think (along the above lines).

But I could see a lot of people looking at Doug's post thinking it was the truth without thinking of the actual date, especially since he announced Stonefield Query 3.2 was released right after that. 

Why? Well, even though most of us are pretty clear on the fact that MS won't be doing a VFP 10, there are a lot of people who still think that if we push hard enough, they will (note: they won't).

He definitely got a lot of people with it.

Then when you go skulking around, you find from Tod that FoxPro a Big Hit in China

That's not really "new" news (read his comments for more details on it) - but it is interesting when you think of the huge interest and following VFP has around Europe and Asia.

In the world-wide VFP community, there is still a lot to do. We may have slipped to #19 on the TIOBE index but we're still in the top 20 and we haven't really started to really push on what's possible with VFP X (to say nothing of Craig Boyd's ambitious VFP Studio project).

We may never be able to get MS to reconsider a VFP 10 - but that doesn't mean we shouldn't keep trying to show that FoxPro can compete in a DotNet, 2GB+ world in its current (and future VFPX) forms, not as a dying tool but as a tool that can hold its own.

Tuesday, April 01, 2008

VFPX - Themed Controls Demo Totally Rocks!

If you haven't checked out Emerson Reed's Themed Controls for VFP, you definitely need to. The link here (VFPX - Home )  shows some samples and there's a video as well but why not simply download the sample code and run it.

One key point: don't build the SAMPLE project and try to run it - just open it, and run MAIN.PRG for best results.

It combines the use of GDI+ and other VFPX projects (CTL32) and just makes the sample app look beautiful. I'm running an earlier version on some of my apps (and they work beautifully) but now I'm definitely going to upgrade to the most recent update.

One key thing to keep in mind: it's all NATIVE FoxPro!  
Blogged with the Flock Browser

Foxpro - The Evolution of a New Standard

Want a blast from the past?

Check out this 1990 ad for FoxPro 2.0 up on YouTube. Foxpro - The Evolution of a New Standard

Not sure, where it played but very cool to watch.
Lots of footage with Dr. Dave but also some great cameos with Adam Green, Tom Rettig, Richard Grossman, Pat Adams, Walt Kennamer, George Goley, (not sure about some of the others: Lucy Lockwood, Michael Masterson)

memo fields: "text processing...the single biggest new market opened up by FoxPro"

I remember when 2.0 first came out for DOS (I was building apps with 1.1 as well as FoxBase+Mac)

There's another funny one here back from 1993 featuring Brad and Karen - I guess this is back when Microsoft's marketing budget wasn't quite as big.

Now we need a VFPX video! -  oh yeah, there's an older promo one right here.