Thursday, December 22, 2016

New White Papers for 2016

I added a half-dozen new white papers to my web site, all from sessions or articles I wrote in 2015: I also added the date the paper was originally written or presented and where.

The new ones are:

  • Win32API for VFP Developers: The Windows API (Win32API) contains thousands of useful functions. However, finding which function to use when, and how to call it from a VFP application, can be challenging. This document discusses how API functions are called in VFP, where to find information on the API, and presents lots of useful API functions you can call in your VFP applications today. (This is an updated version of an earlier white paper).
  • Scheduling Tasks: Automatically executing a task on a regular schedule isn't something every application needs to do, but if you do need it, this document provides the code you need to do this from VFP.
  • 50 Shades of Grey: Whipping Your Application's UI into Shape: There's no excuse for creating a boring looking VFP application. Using some of the controls available today, you can create a new, modern user interface for your forms that'll add years to the life of your applications. With a few days of effort, your apps can be as pretty as anything out there. This document looks at several new controls that allow you to freshen your user interface and wash out the grey.
  • Creating a Plug-in Architecture for Your Applications: Adding support for plug-ins to your applications has a lot of benefits: users can extend or alter the functionality of the application, you can deploy new features without installing a new build, and you can create customer-specific versions of an application without endless sets of CASE statements. This document looks at how adding plug-in support can help your applications and looks at several techniques that can be used independently or together.
  • New UI Classes From Carlos Alloatti: Carlos Alloatti is a prolific developer of classes that can make your application's user interface sparkle. In this document, Doug looks at a couple of new libraries Carlos created that can replace the VFP Toolbar and provide a tabbed document interface to your applications.
  • Add Gauges to Your Applications: They say a picture is worth a thousand words. That's especially true with a gauge control, which allows a user to see at a glance how some value compares to a goal amount. In this document, Doug presents an easy-to-use gauge control you can use in your VFP applications. 

Friday, September 30, 2016

Announcements from Southwest Fox 2016

Southwest Fox was once again a great success. Attendance was down only two people from the previous year, and since attendance seems to go in two-year cycles, that bodes well for next year.

Here are some announcements made at the conference:

  • Southwest Fox 2017 will be held October 26 – 29 at the SanTan Elegante Conference Center in Gilbert, AZ (not in Canada, as I joked in the closing session, because 50% of American attendees will be moving there after the elections in November).
  • The 2016 VFPX Administrator’s Award went to Marco Plaza for his work on nfJSON, nfXML, and nfRegExpTest.
  • The 2015 Speaker Award went to Bobby Spyros Drakos (an Xbase++ speaker).
  • You can watch the first part of the keynote at SWFoxTV and Phil Sherwood's "You 2.0" keynote on YouTube: Part 1, Part 2, and Part 3 (unfortunately, the audio isn't very good).

Wednesday, September 07, 2016

DBI Offers New Control to Southwest Fox/Xbase++ Attendees

DBI is giving away a full license of Calendar COM (ctxCalendar) to each Southwest Fox/Southwest Xbase++ 2016 attendee. Calendar COM is a really great Outlook style scheduling control with three fully extensible views baked into one control: a multi-column Day View (a multiple day appointment scheduler for one resource or multiple resource appointment scheduler for one day at a time), a Week View Appointment Scheduler, and a Month Calendar / date picker. It comes in both 32-bit and 64-bit versions.

DBI has been a long-time supporter of Southwest Fox and we thank them for their generous support once again this year!

Tuesday, August 23, 2016

Rendering a Report Image in the Foreground

A feature I’d forgotten about in the VFP 9 reporting enhancements is the ability to absolutely position objects. As Cathy Pountney discusses in What's New in the Visual FoxPro 9.0 Report Writer, you can use this feature to add a watermark to a report. One problem, though, is that regardless of how you arrange objects using Sent to Back or Bring to Front, the image always appears in the background of the report. What if you want it to appear in the foreground (that is, on top of the detail band objects)?

A little-used reporting enhancement to the rescue. FX and GFX objects extend a report listener by hooking into the various events, allowing you to change the behavior of the report run. These objects can be of any base class, as long as they have an ApplyFX method that accepts certain parameters, but it’s easier to subclass FXAbstract in _ReportListeners.vcx in the FFC folder. The difference between an FX and a GFX object isn’t in the class definition; it’s just that the report listener pays attention to the return value of a GFX object’s ApplyFX method, whereas it doesn’t for an FX object. To add an FX or GFX object to a listener, use:

loListener.AddCollectionMember(Class, Library, APP or EXE, .T. for singleton, .T. for GFX or .F. for FX)

I created a subclass of FXAbstract that does the following:

  • When the report run starts (tcMethodToken is “BEFOREREPORT”), create an array of Empty objects, one for each image in the FRX file that has “FOREGROUND” in its Comment property (the record number of the image in the FRX is used as the index for the object in the array).
  • When such an image is rendered (tcMethodToken is “RENDER”), save its rendering information (left, top, height, width, etc.) to the corresponding Empty object in the array and tell the listener to not render the image by returning 2.
  • When the page footer band is entered (tcMethodToken is “BEFOREBAND” and the first of the variable parameters is 7), tell the listener to render each of the images. Because they’re being drawn after the detail band text, they’ll appear on top of the text.

Here’s the code for the class:

define class SFFXRenderInForeground as FXAbstract of home() + ;

    dimension aForeground[1]
        && an array of rendering information
    lSelfCall = .F.
        && .T. if we're being called from ourselves (we call Render which calls
        && us)
    function ApplyFX(toListener, ;
        tcMethodToken, ;
        tP1, ;
        tP2, ;
        tP3, ;
        tP4, ;
        tP5, ;
        tP6, ;
        tP7, ;
        tP8, ;
        tP9, ;
        tP10, ;
        tP11, ;
        local lnReturn, ;
            lnSession, ;
            lnSelect, ;
            lnCurrRecno, ;
            lnRecno, ;
            lnI, ;
        do case

* Before the report runs, create an array of information about objects we'll
* process.

             case tcMethodToken = 'BEFOREREPORT'
                lnSession = set('DATASESSION')
                if toListener.FRXDataSession > -1
                    set datasession to toListener.FRXDataSession
                endif toListener.FRXDataSession > -1
                lnSelect = select()
                select FRX
                lnCurrRecno = recno()
                scan for 'FOREGROUND' $ upper(COMMENT)
                    lnRecno = recno()
                    dimension This.aForeground[lnRecno]
                    This.aForeground[lnRecno] = createobject('Empty')
                endscan for 'FOREGROUND' $ upper(COMMENT)
                if between(lnCurrRecno, 1, reccount())
                    go lnCurrRecno
                endif between(lnCurrRecno, 1, reccount())
                select (lnSelect)
                set datasession to lnSession

* If we're rendering an object that's supposed to be in the foreground, save
* the rendering information.

            case not This.lSelfCall and tcMethodToken = 'RENDER' and ;
                vartype(This.aForeground[tP1]) = 'O'
                loForeground = This.aForeground[tP1]
                addproperty(loForeground, 'FRXRecno', tP1)
                addproperty(loForeground, 'Left',     tP2)
                addproperty(loForeground, 'Top',      tP3)
                addproperty(loForeground, 'Width',    tP4)
                addproperty(loForeground, 'Height',   tP5)
                addproperty(loForeground, 'ContType', tP6)
                addproperty(loForeground, 'Contents', tP7)
                addproperty(loForeground, 'Image',    tP8)
                lnReturn = 2 && OUTPUTFX_BASERENDER_NORENDER

* If we're about to do the page footer band, render all foreground objects.

             case tcMethodToken = 'BEFOREBAND' and tP1 = 7
                 && FRX_OBJCOD_PAGEFOOTER
                for lnI = 1 to alen(This.aForeground)
                    loForeground = This.aForeground[lnI]
                    if vartype(loForeground) = 'O'
                        This.lSelfCall = .T.
                        toListener.Render(loForeground.FRXRecno, loForeground.Left, ;
                            loForeground.Top, loForeground.Width, loForeground.Height, ;
                            loForeground.ContType, loForeground.Contents, ;
                        This.lSelfCall = .F.
                    endif vartype(loForeground) = 'O'
                next lnI
        return lnReturn

The following code tests the GFX object by running a report with and without it.

open database _samples + 'Data\TestData'

loListener = newobject('FXListener', home() + 'FFC\_ReportListener.vcx')
loListener.ListenerType = 1 && LISTENER_TYPE_PRV
report form Foreground object loListener
loListener.AddCollectionMember('SFFXRenderInForeground', ;
    'SFFXRenderInForeground.prg', '', .T., .T.)
report form Foreground object loListener

Here’s what the report looks like without the GFX object:


You can see the image is drawn under the text. Here’s the report when the GFX object is used:


Notice the image now appears on top of the text.

You can download the source and sample files for this from the Technical Papers page of my personal web site, (look for “Rendering a Report Image in the Foreground”).

Monday, August 22, 2016

The FoxShow #81 is now available

Listen to Andrew MacNeill interview Tamar Granor and me about Southwest Fox and Southwest Xbase++ 2016 on the FoxShow #81. There's a special offer for FoxShow listeners until September 2.

Wednesday, July 27, 2016

Southwest Fox 2016: Early-bird deadline approaches

Simple quick reminder: save $50 by registering before the Early-bird registration deadline this Sunday, July 31st.

If you still need to register, please head over to the registration Web site today:

Every registered attendee gets admission and white papers to all regular conference sessions. Don't miss this chance to learn from the best and mix with your peers.

It’s still only July and we already have nearly $15,000 in raffle prizes, with more yet to come.

See you in September!

Friday, July 01, 2016

Southwest Fox/Southwest Xbase++ 2016 are a Go!

We have some good news to share today. Thanks to the support of both the Visual FoxPro and Xbase++ communities, Southwest Fox and Southwest Xbase++ 2016 will proceed as planned September 22-25, 2016 in Gilbert, AZ.

We really appreciate all the support people have shown for the conference with early registrations! That said, the decision comes with a calculated risk because we are still many registrations short of the breakeven point. Please continue to spread the word to your colleagues, clients, user group and anywhere else Visual FoxPro or Xbase++ is spoken.

If you haven't yet registered, there's still room for you. Register before August 1 for a $50 early-bird discount.

Contact Us:

Only 83 days until we gather in Gilbert.

Monday, June 27, 2016

Southwest Fox 2016 Super-Saver Deadline Approaches

The countdown clock is ticking! The Super-Saver deadline for Southwest Fox and Southwest Xbase++ 2016 is June 30th, just a few days away. We still need people to register to make the conferences happen.

The conferences take place September 22-25 in Gilbert, Arizona and we really hope you can be there. We would hate to see you miss out on the $125 discount, the FREE pre-conference session, and an opportunity to win a scholarship or a license of Stonefield Query SDK (a $6,000 value).

After checking out our list of amazing speakers and digging into our session tracks for VFP and Xbase++, head over to the registration Web site today:

Wednesday, June 01, 2016

Registration for Southwest Fox 2016 now available

Registration for Southwest Fox and Southwest Xbase++ ( is now available. See for a list of speakers and for a list of sessions. Super-Saver Registration, which saves you $125, is available only through June 30th, so don't wait.

Putting on a conference is a risky endeavor. Conference centers require a guaranteed minimum income to block the dates of a conference; for a conference like Southwest Fox, that minimum is in the tens of thousands of dollars. We have to commit to the conference center by July 2nd and need your support by July 1st to make that commitment. We will not send out any "We need your help" appeals so please do not wait; register by June 30th! We know most of you like to wait until the last minute to avoid the credit card bill arriving too soon. We will not charge any attendee credit cards or cash any checks until we have committed to going forward (sometime after July 2), so this is not is a reason to wait.

Rick, Tamar, and I look forward to seeing you in September!

Friday, May 06, 2016

Southwest Fox and Southwest Xbase++ 2016 Speakers and Sessions Announced

Speakers and sessions for both conferences have been announced. We have three new speakers this year: Alec Gagne, Andreas Gehrs-Pahl, and Chris McGuinness. I’ve known Alec and Chris for a while and am looking forward to meeting Andreas. We also have three speakers who spoken before but not in a few years: Venelina Jordanova, Jody Meyer, and Eric Selje.

I think I’m more excited about the session lineup this year than ever before. Some sessions I’m personally looking forward to seeing are:

I’m also really pumped about my two sessions: Creating Beautiful Web Sites Easily Using Bootstrap and Lessons Learned in Version Control. In fact, I’m so stoked, I’ve already started working on the white papers, which is a couple of months earlier than usual for me.

Registration opens soon; send an email to if you want us to email you when it’s ready. See you in September!

Monday, February 29, 2016

Southwest Fox 2016 Session Proposals Due Friday

This is just a reminder that session proposals for Southwest Fox 2016 and Southwest Xbase++ 2016 are due by 8 AM EST this Friday, March 4. If you are interested in presenting at either conference, please read the Call for Speakers and submit your proposals via the Geek Gatherings Submission Web site.

Thursday, February 25, 2016

Subscribe to ssUltimate

Jun Tangunan, the 2012 Ceil Silver Ambassador to Southwest Fox, is an incredible resource to the FoxPro community. His blog has great tips and sample code, with particular emphasis on interesting user interfaces such as colorful buttons and containers, date/time pickers, popup calculators, and much more.

Although almost everything Jun provides is free, he does ask for a $35 US fee for his ssUltimate library. That small fee is well-worth it: you get a ton of really cool classes (some of which I showed at Southwest Fox last year) that help modernize and polish your application’s UI. However, the best part is that Jun doesn’t keep any of the money for himself: it goes to helping out flood victims in the Philippines.

This is a no-brainer, folks. You get a great library of classes from a very talented and really nice guy and help out flood victims at the same time. Payment can be made via PayPal to Subscribe today!

Friday, February 19, 2016

Executable Signing Using SHA-256 Certificates

A few weeks ago, a customer complained that when they downloaded the installer for Stonefield Query, they got a warning that the download was corrupted. I tried it myself and couldn’t reproduce it, so I assumed their anti-virus software was the culprit. Then a second customer had the same problem, and then a third. Googling the error message led me to this article describing the real problem: executables signed with SHA-1 certificates (which ours are) are blocked after January 1, 2016 (although it appears to be an issue on some operating systems and not others because, as I said, the downloads worked for me). Although my certificate provider had been sending me emails about upgrading to a SHA-256 certificate, for some reason, I thought it only applied to web servers.

Several years ago, I discussed signing executables with Inno Setup (which incidentally is my most popular blog post ever). There are a few changes necessary to using a SHA-256 certificate with Inno Setup, so I thought I’d document the entire process here, even those things that aren’t specific to the new certificates.

Once you’ve purchased a certificate from your chosen provider, you’ll likely get an email with a link to download the certificate into the certificate store on your machine. Normally, you’ll want the certificate in file form to make signing easier, so you need to get it out of the certificate store after you’ve downloaded it. To do so, do the following:

  • Start the Certificate Manager snap-in by running CertMgr.msc.
  • The downloaded certificate is in the Personal\Certificates section. Right-click the certificate and select All Tasks, Export to bring up the Certificate Export Wizard.
  • In the Export Private Key step, choose Yes, export the private key.
  • In the Export File Format step, Personal Information Exchange (.PFX) is already selected. Make sure Include all certificates in the certification path is turned on (it should be by default). Turn on Export all extended properties.
  • In the Security step, turn on Password and enter a password.
  • In the File to Export step, enter the name of the PFX file to create.

You can then use SignTool to sign EXEs using the PFX file. SignTool comes with Microsoft Visual Studio and the Microsoft Windows SDK. If you don’t have Visual Studio, you can download the SDK from Microsoft’s web site; search for “download Windows SDK” to find the appropriate download page. You can typically find SignTool.EXE in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1a\Bin (the version number may be different depending on what version of the SDK you download and it may be in C:\Program Files instead). Here’s an example of a command to sign an EXE (the section highlighted in yellow is new for SHA-256 certificates):

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1a\Bin\signtool.exe" sign /fd SHA256 /tr timestampServer /td SHA256 /f certificatePath /p password /d "description" fileToSign

where timestampServer is the URL to your certificate provider’s timestamp server so the certificate can be timestamped (see your provider’s documentation), certificatePath is the path to the PFX file, password is the password for the PFX, description is the description for the digital signature, and fileToSign is the path to the EXE to sign. Remember to add quotes around any path containing spaces.

It’s actually even easier than that to sign the installer generated by Inno Setup. You can do it one of two ways:

  • In the Inno Setup Compiler, choose Configure Sign Tools from the Tools menu, click Add, specify a name (I use “Standard”), and enter something like the following for the command:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe sign /fd SHA256 /tr timestampServer /td SHA256 /f certificatePath /p password $p

Note there are no quotes in the path and that $p is a placeholder for the SignTool parameters specified in the [Setup] section. Then add the following to the [Setup] section of your ISS file:

SignTool=Standard /d $q{#MyAppName}$q $f

$q is a special symbol meaning insert a quote (you can’t use actual quotes here) and $f is a placeholder for the name of the file to be signed. This assumes you have a constant defined for MyAppName. If not, use whatever you wish for the description.

  • If you compile your ISS file using the Inno command line compiler, pass the following parameter to the compiler:

"/sStandard=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\ signtool.exe sign /fd SHA256 /tr timestampServer /td SHA256 /f certificatePath /p password"

Be sure to put the certificate in a path with no spaces in any of the folder names or you’ll get unhelpful error messages when you build the setup.

Tuesday, February 16, 2016

New VFPX Gauge Project

The new VFPX Gauge project allows you to quickly and easily draw attractive gauges and dashboards in your VFP applications. It uses an open source .NET component to do the actual drawing along with a small VFP wrapper class. A couple of sample forms show how to use the gauge control. Check it out!


Friday, February 12, 2016

Southwest Fox/Xbase++ 2016 Call for Speakers

Anyone interested in speaking at this year's conferences is invited to submit topics. See the Call for Speakers page for details.