Thursday, June 06, 2019

Integrating Project Explorer with Search Utilities

I’ve been using Project Explorer as a replacement for the VFP Project Manager for a couple of years now. However, I recently ran into a gotcha that I need to handle better. Here’s the story.

If you have it configured to do so (and I do), Project Explorer automatically generates the text equivalent of a binary file such as a form or class using whatever conversion tool you’ve specified (I use FoxBin2Prg) when you’re finished editing the item. I rely on this heavily: every day, I’m modifying some class or another, knowing the VC2 file is automatically created so I don’t have to do it manually. Since our source control repository contains only the text equivalents, not the binary files, this is very important.

The build process for Stonefield Query Enterprise Studio, the developer tool for the web version of Stonefield Query, runs on a build server. It pulls from the remote repository, uses FoxBin2PRG to generate binary files from the text equivalents, builds an from the PJX file, and uses Inno Setup to generate a setup executable.

Recently, one of our developers discovered a bug in Studio. It sounded like something I had just fixed, so I couldn’t reproduce it in my copy, but could in the version generated from the build server. I checked the VCX/VCT files from the build server and sure enough, the class had the unfixed bug. I checked my copy: it had the bug fix. Then I looked at the VC2 file on my machine and saw that the bug was still there. But how could that be?

Then I remember how I’d fixed the bug. I opened my project search utility (yes, I’m aware of GoFish and even use it from time to time, but my utility does 99% of what I need and is way faster), searched for some text, double-clicked the class it found, fixed the bug, and closed the Class Designer. The problem is that since even though Project Explorer was open, it wasn’t asked to open the class, so it didn’t know the class had been changed and didn’t call FoxBin2PRG to generate the VC2 file, so the bug still existed in that file and in our repository.

Of course, it was easy to resolve the problem: generate the VC2 file for the class, commit the change, push to the repository, and run the build process again. But I wanted to make sure this didn’t happen again, so I added a new method to Project Explorer: EditFile. It has the same syntax as EDITSOURCE, but when you close the editor, Project Explorer automatically calls FoxBin2PRG if the file is a binary just like it does if you click the Edit button in Project Explorer. Then I edited my project search utility:

if type('_screen.oProjectExplorers') = 'O' and _screen.oProjectExplorers.Count > 0
    loPE = _screen.oProjectExplorers[1]
endif type('_screen.oProjectExplorers') = 'O' ...
do case
* Other code here.
    case FILES.TYPE = FILETYPE_FORM and vartype(loPE) = 'O'
        loPE.EditFile(lcFileName, lnLineNo, justfname(lcFileName), lcMethod)
    case FILES.TYPE = FILETYPE_FORM
        editsource(lcFileName, lnLineNo, justfname(lcFileName), lcMethod)
    case vartype(loPE) = 'O'
        loPE.EditFile(lcFileName, lnLineNo, lcClass, lcMethod)
    otherwise
        editsource(lcFileName, lnLineNo, lcClass, lcMethod)
endcase

So, when I tell my utility to edit a file containing the search text, it either uses EDITSOURCE if Project Explorer isn’t open or it calls Project Explorer’s EditFile method if it is. Problem solved. The latest version of Project Explorer on GitHub has this change.

I haven’t updated GoFish or Code References but posted an issue with both projects in case the developers or someone want to add support for Project Explorer.

Wednesday, May 22, 2019

Southwest Fox 2019 Registration Now Open

Registration for Southwest Fox (http://www.swfox.net/register.aspx) is now available. See http://www.swfox.net/speakers.aspx for a list of speakers and http://www.swfox.net/sessionsswfox.aspx 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 October!

Monday, May 06, 2019

Southwest Fox 2019 Speakers and Sessions Announced

Speakers and sessions for Southwest Fox 2019 have been announced. We like to have at least one new speaker each year, and this year it’s Tracy Pearson, presenting sessions on calling VFP COM objects in C# applications and implementing automated builds for VFP applications.

Besides Tracy’s sessions, I’m especially looking forward to seeing the following sessions:

I am, of course, also fired up about doing my own sessions: Creating Dynamic Object-Oriented Reports and Menus and Adding Features to Your VFP Applications Using C#. I think the latter is going to be really useful for anyone wanting to add new features to their VFP applications that would be difficult to do in pure VFP code but relatively easy using .NET.

Monday, March 18, 2019

Minimizing West Wind HTML Help Builder Uploads

I’ve been using West Wind HTML Help Builder for about twenty years (it’s hard to believe it’s been that long, but I checked) and still love it as much as ever. I looked at a lot of HTML Help generating tools over the years and it’s still the best one in my opinion.

One of the features I love about it is the ability to generate not just a CHM file for a desktop application but also HTML files for a web application or to post the documentation on a web site. For example, we provide online versions of the developer and end-user documentation for our products (for example, for the Stonefield Query report designer), both so prospective customers can review it before they buy and so we can point customers asking support questions to the relevant topic with a simple URL instead of “open the help, then navigate to …”.

At a recent conference, I was asked if there’s a way to reduce the number of files needed to be deployed to a web site to provide online help. I used to deploy the files directly from the project folder so I wrote some code that uploaded only those files that are actually required because there are a ton of files that aren’t. Fortunately, I don’t need to do that anymore because a new feature in Help Builder does this automatically: after building the help, click the Copy to Folder button to create a deployment folder with only the required files, then use something like FileZilla to upload the contents of that folder to the web site. FileZilla and other FTP programs are typically faster than homegrown code like mine or the code used for the FTP Web Upload function in Help Builder, likely because they use multithreading to upload several files or chunks of files at once rather than one at a time.

However, even the Copy to Folder function copies a few more files than necessary. Here are files you can delete from the deployment folder before uploading (which of course you could automate with a PRG or PowerShell script):

  • bmp: any images for topic types you aren’t using, such as classcontructor.png. Typically, the only ones I keep are folder.png, header.png, index.png, topic.png, and whatsnew.png. Also, the contents of the image subdirectory of the bmp folder aren’t used anywhere and can be deleted.
  • html: this folder is empty and can be ignored.
  • images\images: the only file in this folder is wwhelp.png and it doesn’t appear to be used anywhere (there’s another copy of this file in images, which is used in the various HTML documents unless you customize the templates to not use it as I have).
  • templates\scripts: ww.jquery.js: this is the unminified version of ww.jquery.min.js.
  • templates\scripts\bootstrap\dist\css: bootstrap.css, bootstrap.css.map, bootstrap-theme.css, bootstrap-theme.css.map: these are unminified versions of other files or map files which aren’t needed.
  • templates\scripts\bootstrap\dist\js: bootstrap.js, npm.js: unminified or unneeded files.
  • templates\scripts\highlightjs\styles: any css file you aren’t using, as determined by the Theme setting in the Content Editor page of the Options dialog. I typically use vs2015.css in my projects so I delete the rest.
  • templates\scripts\jquery: jquery.js, jquery.min.map: unminified or map files.

Removing unused files saves about 1.5 MB, which may not sound like much in these days of large hard drives, but that shaves a bit of time off the upload process.

Wednesday, March 13, 2019

New FoxMock Project on VFPX

Christof Wollenhaupt’s FoxMock project is now available on VFPX. FoxMock is an object mocking framework that works with testing tools such as FoxUnit to make it easy to define objects without having to create specific test classes. Christof discussed FoxMock in one of his sessions at Southwest Fox 2012.

Tuesday, February 19, 2019

Southwest Fox 2019 Call for Speakers

We've issued the Call for Speakers for Southwest Fox 2019. If you are interested in presenting, please read the document referenced in that page and consider submitting sessions via the Geek Gatherings Submission Web site.

Thursday, January 24, 2019

Update to VFPX Upsizing Wizard

I released an update to the VFPX Upsizing Wizard today. It has a couple of changes:

  • It handles large tables better. The bulk XML load process, which is by far the fastest way to upsize the records in a table, creates an XML file using CURSORTOXML and then uses the SQLXML COM object to process that file. With a large table, the XML file could be more than 2 GB, which causes CURSORTOXML to fail, so the Upsizing Wizard reverts to using a slower mechanism. In this update, the bulk XML load routine now processes large tables in batches so the XML file never gets bigger than about 1 GB.
  • It renames the built-in tables Keywords.dbf, ExprMap.dbf, and TypeMap.dbf to have an underscore prefix to avoid conflict with tables using those names in the database to be upsized (this was an issue someone ran into).

Note: since SQL Server 2008, the SQLXML module that supports bulk XML load is no longer automatically installed, so if you find bulk XML load isn’t being used, it may be because the COM object doesn’t exist. In that case, download it from https://docs.microsoft.com/en-us/sql/relational-databases/sqlxml/what-s-new-in-sqlxml-4-0-sp1?view=sql-server-2017.

Tuesday, October 23, 2018

Southwest Fox 2018

Once again, Southwest Fox 2018 exceeded all of my expectations. Everyone seemed really excited about the sessions and being back to meet old and new friends. I met a couple of people who I only knew online so it was nice finally meeting them in person. And of course there’s nothing like hanging out with old friends, some of whom I’ve known for more than 20 years.

I almost lost my voice before the start of one of my sessions but fortunately Christof Wollenhaupt gave me a package of Fisherman’s Friend, which those in attendance can attest worked quickly and amazingly well. I’m taking Christof’s suggestion and keeping some in my backpack from now on just in case.

Congratulations to the 2018 VFPX Administrators Award winner Tore Bleken for all of the work he did on documentation for Thor, IntelliSenseX, and Win32API.

We announced dates for next year's conference already: October 24 - 27, 2019. I hope to see you in Phoenix next year!

Update: the keynote presentation can now be viewed online.

Thursday, September 27, 2018

New VFPX Project: Log4VFP

I released a new project on VFPX this week: Log4VFP. Log4NET is a powerful diagnostic logging library for .NET applications. Log4VFP provides a VFP wrapper for Log4NET, allowing you to add advanced logging features to your VFP applications. I’ll be showing it in my VFPX 2018 Edition session at Southwest Fox next month.

Wednesday, July 25, 2018

Southwest Fox 2018: Early-bird deadline approaches

Simple quick reminder: save $50 by registering before the early-bird registration deadline next Tuesday, July 31st.

If you still need to register, please head over to the registration Web site today: http://geekgatherings.com/Registration

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.

See you in October!