Monday, November 26, 2007

Edit Property/Method Dialog Replacement Available

On Friday, I posted an update for the VFPX New Property/Method Dialog Replacement project that adds a new feature: a replacement for the Edit Property/Method dialog, created by Marcia Akins.

In case you're not familiar with this project, its purpose is to replace the native VFP New and Edit Property/Method dialogs with dialogs that have a lot more functionality. The New dialog has the following features:
  • It automatically updates the _MemberData property (adding that property if necessary) so the case entered for the new member is used (even for access and assign methods if they're created as well) and the member is displayed on the Favorites tab if that option is turned on in the dialog.
  • It's non-modal. That means you can keep it open, add some properties or methods, switch to other things, come back, and add some more members.
  • How many times have you accidentally selected the wrong dialog, entered the name and description, only to realize your mistake and have to close the dialog and start all over? With the replacement dialog, you can switch between Method and Property without closing the dialog.
  • It's dockable: try tab-docking it with Properties window.
  • It's resizable and persists its size and position to your resource (FOXUSER) file.
  • It has an Add & Close button to perform both tasks with one click.
  • The default value for a property is automatically set to a value based on the data type of the property if you use Hungarian names. For example, lTest would be logical, so the default value is .F. For nTest, the default is 0.
  • For logical properties (those with a default value of .T. or .F.), turning on the Use Toggle Editor option installs a property editor that allows you to double-click the property in the Properties window to toggle its value. This property editor is included inside NewPropertyDialog.APP.
  • It hides rather than disables non-applicable controls. Since this one dialog is used for both New Property and New Method for both the Class and Form Designers, some options may not be applicable for a given instance.
  • It disallows invalid names when you enter them rather than when you click on Add or Add & Close.
  • The Add buttons are only enabled if a name is entered.
The Edit dialog has the following features:
  • It automatically selects the chosen member when you right-click a member in the Properties window and choose Edit Property/Method from the shortcut menu.
  • While it's easy to add a member to the Favorites tab of the Properties window (right-click and choose Add to Favorites), there isn't an easy way to remove it from Favorites. The replacement dialog has a Favorites button, making it easy to add or remove a member from Favorites.
  • If you delete a member that has associated member data, the member data is automatically removed for that member.
  • It automatically updates the member data when you rename a member so it respects the case of the member's name.
  • Like the New Property/Method dialog, it's non-modal, dockable, resizable and persistent, and allows changing a property to a method and vice versa.
  • Selecting the description of a member and pressing Ctrl+C to copy it causes the Apply button to become enabled in the native dialog, requiring you to either choose Apply or Cancel to close the dialog (pressing Esc brings up a "save changes" dialog). The replacement dialog does not have this behavior.
  • The New button launches the replacement New Property/Method dialog.
  • The Zoom window (right-click on the Properties window for a property and choose Zoom) is resizable.
Documentation is provided in a CHM file, but like every downloaded CHM has an issue with security. To fix that, right-click the CHM, choose Properties, and click Unblock.

To install the dialog, download the code and run both of the APP files. This will install the necessary MENUHIT and MENUCONTEXT records into your IntelliSense table to enable the new dialogs. Full source code is provided so feel free to check out how these dialogs work. Please post any suggestions for improvements to the VFPX site.

Thursday, November 22, 2007

Fixing the "Reinstall Your App" Problem

Have you ever installed a new application only to find that running an old application now brings up a dialog asking to install it or a completely different application? That happens because when updated ActiveX controls are installed, their InprocServer settings in the Windows Registry, which points to the physical location of the OCX file, are overwritten with Windows Installer encrypted keys. When you run an older application that uses those ActiveX controls, Windows Installer thinks there’s something wrong with the ActiveX control and so prompts you to reinstall the application. This is a common conflict between VFP applications using ActiveX controls like the TreeView and Microsoft Office, for example.

This problem doesn't occur if you use Inno Setup instead of Windows Installer-based tools such as InstallShield. In the mean time, the workaround is to find the Registry entry for the ActiveX control and fix its InprocServer32 entry. This is easier said than done, because you don't necessarily know which control to fix; you need to find entries for all the controls your app uses. Here's how you do this:
  • Launch RegEdit.
  • Find "treeview" or whatever control you're looking for. The entry you want is in HKEY_CLASSES_ROOT\CLSID and it'll be a GUID. For example, for the TreeView control version 6, the entry is HKEY_CLASSES_ROOT\CLSID\{C74190B6-8589-11D1-B16A-00C0F0283628}.
  • Look in InprocServer32 for the InprocServer32 key. It's supposed to contain the name and path for the OCX, but notice it contains gibberish; that's the Windows Installer encrypted key that's causing the problem.
  • Edit the value and replace it with the name and path for the OCX; for the TreeView control, it should be C:\Windows\System32\MSComCtl32.OCX (the "(default)" value contains this, so you can copy it from there and paste it into InprocServer32).
  • Repeat for each of the controls your app uses.

Monday, November 19, 2007

New Southwest Fox Blog

A new blog dedicated to Southwest Fox is now available.

Update for Sedna Upsizing Wizard

Someone recently emailed me about a couple of changes they wanted in the new Upsizing Wizard in Sedna. One was the ability to select Varchar(MAX) as the data type to use when upsizing a memo field. The other was the ability to use a different date in the place of blank VFP dates; the default in the Upsizing Wizard is 01/01/1900 but they wanted to use 12/31/1899 instead.

The first change simply involved adding a new record to TypeMap.DBF, the table containing the type mappings. Set LocalType to "M" (for Memo), FullLocal to "memo", RemoteType to "varchar(max)", and Server to "SQL Server". Leave the logical fields as .F., especially VarLength, which determines whether the user is prompted for a field length.

The second was a little more work. First, BulkXMLLoad.PRG needs a change to support this because it used a hard-coded value. Change the statement setting ltBlank to:

ltBlank = iif(vartype(ttBlank) $ 'TD', ttBlank, SQL_SERVER_EMPTY_DATE_Y2K)
and add the following statement after the LOCAL statement:

#include Include\AllDefs.H
Second, JimExport (interesting method name!) in WizUsz.PRG also used a hard-coded value, so change the assignment to lcEmptyDateValue in the first CASE statement to:

lcEmptyDateValue = "IIF(EMPTY(" + ALLT(lcCursorName)+'.'+ALLT(aTblFields[ii,1])+ "), " + ;
transform(This.BlankDateValue) + ","
Finally, to change the actual date, change these two constants in AllDefs.H to the desired values:
#DEFINE SQL_SERVER_EMPTY_DATE_Y2K {^1900-01-01}
#DEFINE SQL_SERVER_EMPTY_DATE_CHAR "01/01/1900"
Rebuild UpsizingWizard.APP and you're ready to go.

Tuesday, November 06, 2007

Cathy Blogs!

In the "it's about time" category, Cathy Pountney has started blogging. Looks like the arm twisting we did at Southwest Fox did the trick. I'm really looking forward to her posts. Her sessions at Southwest Fox were very well attended and rated (we're compiling the evals right now), so being able to get snippets of her wisdom on a regular basis is most welcome.

Friday, November 02, 2007

My Newest Time Waster

Rick Schummer blogged yesterday about a new time waster for him: 3-D Pong. My new time waster is xkcd.com, "a webcomic of romance, sarcasm, math, and language". And programming: check out Exploits of a Mom. I actually laughed out loud at that one. Then I started going through some of the several hundred other comics in the collection and poof, an hour had gone by. Fortunately, it has an RSS feed so I can get my daily dose.

Heading for Germany and Holland

On Tuesday, I'm heading for Frankfurt for my third German DevCon (and the 14th edition of this great conference). About 1/3 of the sessions are in English, and there are English sessions in almost every timeslot, so if you're unilingual as I am (and not proud of it, either), there are plenty of great sessions by speakers such as Andy Kramek, Marcia Akins, Rick Schummer, Steve Black, Craig Berntson, and Alan Griver to attend. I'm even planning on attending a couple of German sessions, in particular Christof Wollenhaupt's session on Guineu. He showed a few minutes of it during the Southwest Fox keynote, enough to whet my appetite for more.

One of the interesting things about German is that it seems to be relatively easy to pick up at least a few words. There are lots of similarities between words in German, English, French (which I took in high school 75 years ago), and Dutch (which my wife speaks fluently so I've picked up a very small amount), enough so that sometimes I can at least get the gist of a conversation if not the details. Plus, in technical sessions, there seem to be actual English words in almost every sentence, and of course, code is code.

After DevCon, Rick Schummer and I head for Holland to speak at a one-day VFP conference hosted by Software Developer Network. The next day, we're going to do some sightseeing in Amsterdam, which I visited five years ago and have been wanting to go back to. Rick's going to be in shock when he sees the Red Light District, which we pretty much can't avoid since it's right by the central train station.

Thursday, November 01, 2007

Duct Tape Marketing

I rarely read business books, but as my business partner Mickey's urging (much closer to nagging, actually), I read Duct Tape Marketing by John Jantsch on my flights to and from Phoenix for the Southwest Fox conference. Wow! This is one of those seminal, "this will change your life" kind of books (well, not your life; if this book changed your life, you really needed to get a new life!). The book is an easy read: there's no marketing theory or page-filling fluff; it's just jammed full of ideas and "to-do's" about how to market your business. One of the key points is that you are in marketing even if you don't think you are. Everyone is in marketing to some extent or another.

I was so excited about the ideas I read in this book that I took several pages of notes. Mickey has been ordering copies of this book for everyone in our company, and we're even considering giving it to clients. It's now on my "requirted reading" list.

Friday, October 26, 2007

Southwest Fox 2007 Day 4

Last day. In a way, I'm relieved; this has been a ton of work and an exhausting several days. On the other hand, people I like and respect and only see a couple of times a year or less will be heading home today or tomorrow, so I'm kind of bummed too.

Once again, I missed a session. Bo Durban and I inadvertently did some pair programming. He started showing me some really cool things his product, Moxie Report Objects, does, then mentioned another cool feature he was thinking of adding: a find function in the Report Designer that would find any text in a report expression, group expression, print when expression, etc. He started working on it, I made some suggestions, he tweaked something, and before you knew it, we were pair programming. It was a lot of fun and Bo ended up creating a working version of the code in no time. Once again, it's the networking that's the best part of conferences.

After presenting the second instance of my vertical app development session, I squeezed myself into what little space was left in Cathy Pountney's Outfox the VFP Report Writer session. I'd heard great comments from other attendees and Cathy didn't disappoint. Her session gets my vote for best in show. She showed how to take control of the printing process, giving you the ability to create books (with their out-of-order pagination), offset the top and left edges of a print job, printing N-up pages per sheet, accessing the properties dialog for a printer, and many other things. The best part is that all of the code is on the conference CD, so I can start implementing her ideas right away.

After a quick break to rearrange the four break-out rooms into one large one, we started the closing session. We reminded everyone to turn in their evaluation forms; those that did were entered into a drawing for a free registration to next year's conference. That's how important evals are to us and the speakers. Rick thanked speakers, sponsors and exhibitors, Arizona Golf Resort staff, Rick Borup (for creating the RSS feed for http://www.swfox.net/; we somehow missed thanking him in the keynote), and attendees. We then gave out thousands of dollars in software, books, and other goodies donated by sponsors. We announced the dates for Southwest Fox 2008: October 16 - 19, at a location to be announced later (although it's fairly likely we'll be back at the Arizona Golf Resort). Dave Aring created a cool animated logo just for this (for some reason, it's not animated here):



We listing some resources, such as the Universal Thread, Foxite, Foxforum, user groups, the Fox Wiki, blogs, VFPX, and FoxCentral. We finished up asking for photos and testimonials and wishing everyone a safe trip home.

Rick, Tamar, and I had a lot of people come up to us during and after the conference thanking us for taking up the reins of Southwest Fox and for putting on such a great conference. The buzz at the conference was amazing. Everyone was so jazzed about VFP that they were almost bouncing off the walls. I personally felt totally energized and full of new ideas for my applications, and I'm sure almost everyone else felt the same way.

After cleaning up the conference area and packing up the few things we had to take home, about thirty of us went to the hotel restaurant for lunch. My last meal at the hotel didn't disappoint either; the burger was one of the best I've ever had.

Tamar, Rick, Marshal, Therese, and I then met with the hotel staff for a post-conference debriefing. We told them about the few complaints we had and those we heard from attendees, but they were very picky things; nothing was even close to being a major issue. The hotel staff, especially those in the conference and catering areas, were incredible. When we asked for something, it was cheerfully done in minutes. Mark, Brett, Mari, Sharon, and their staff bent over backwards for us and were always pleasant and fun to work with. We let them know how pleased we were with the facilities and service.

We then had a post-conference meeting of our own, going over things we need to ensure we do next year (such as signage for the registration table and providing coffee and beverages during breaks). We even started planning next year's conference, so save the date!

Rick and Therese headed to Sedona for a few days of much-deserved R & R. About twenty of those still around went to My Big Fat Greek Restaurant for dinner and had some really good Greek food. wOOdy and Christof ordered a Meat Lover's Platter for two that looked like it was really for four; I wanted to see those guys eat that much food, but they were done after less than half the plate.

Thanks again to everyone who helped make this a great conference. We'll see you again next year!

Southwest Fox 2007 Day 3

I went to Alan Steven's Integrating Windows Forms UI Elements session. It was nice to see so many people (the room was almost full) at an 8:00 session, especially given the intensity of the day before, and the pre-con day for those who attended, and the West Wind Web Connection training the two days before that. Alan stressed several times that .NET is not a competitor to VFP; it should be part of every developer's toolkit. He showed how the Windows Forms Interop Toolkit from Microsoft can be used to easily create a .NET Windows form that's exposed as a COM object that can be called from VFP applications. However, not many developers will do that because it's a completely stand alone form. He then showed the new Interop User Control that can be used to easily create ActiveX controls you can drop on VFP forms. He showed how easy it is to raise events in the control so you can put code into the event in your VFP form. Now we can easily take advantage of the really cool UI objects .NET has to offer in our VFP forms. He didn't present this as a means of migrating your apps to .NET but as a way of making your VFP forms look better and have more functionality.

I skipped the next session to catch up on email and forum and blog reading (gotta love free wireless access in the conference area!). I then did the second instance of my VFP Vista session. Once again the room was full, so that means that more than half of the attendees saw this session.

Lunch was again served outside in the courtyard. It was Italian day, so we had antipasto and canneloni. Once again, the food was great. I sat outside and had a lively discussion of health care in Canada vs. the US. The attendee who asked about Canadian health care wished he hadn't; it's one of my hot buttons, and I guess I got a little zealous -- sorry about that! It was pretty warm and I started sweating, so I headed back into the air conditioned comfort of the conference center.

I missed the first post-lunch session because I was chatting with some other attendees. As many people will tell you, networking is one of the best things about going to a conference. I also chatted with several of the vendors. Chick Bornheim from Micromega told me that he had a better response at Southwest Fox 2007 than all of the previous three years combined. Although I really wanted to see Toni Feltman's DBI controls session, I ended up missing that too while talking to folks.

The last session of the day was our vendor session for Stonefield Query and we once again had a lot of people show up, this time without any free beer. I love showing this product and watching the smiles on the faces of developers when they realize how much it'll help their users and themselves in providing a customized reporting solution for their application.

The speakers headed to Rustler's Rooste for a dinner to show our appreciation for all the effort they put into creating sessions and white papers, practicing their sessions, and presenting them to the attendees. The restaurant is massive and has a great view from its location on the side of one of the many mountains in Phoenix. I was a little disappointed in the food, but the company was great. A magician showed off some pretty cool tricks after dinner; we talked about one of them for quite a while afterward.

Those interested in indoor kart racing went to the F1 Race Factory to reprise the races we had at last year's conference. Cathy Pountney narrowed edged out Rick Schummer last year (I was a close third), so there was some serious trash talking in the days preceding Saturday night. Cathy even stooped so low as to bring last year's score card to show off. Unfortunately, we hadn't made a reservation, so when we got there, we were told it would be 11:30 p.m. at the earliest before we could race, so we headed back to the hotel. I hung out in the lobby for a while, but a week of getting up at 5:00 a.m. was taking its toll, so I headed to bed.

Here's a picture of attendees (Steve Sawyer, Sue Cunningham, and Brenda Erickson in the foreground) chatting in one of the courtyards between sessions: