October CTP Available


The most recent CTP for Visual FoxPro 9.0 can now be downloaded from Microsoft. This release contains various Sedna projects (SQL Server Upsizing Wizard, Database Explorer, NET4COM, and MY for VFP) as well as an early preview of Visual FoxPro 9.0 Service Pack 2.0.


Bo Durban and I have been messaging back and forth while we looked this over for the past hour or so. Bearing in mind that this is a CTP and by its very definition there is bound to be problems I’d like to go over a few of my thoughts and problems encountered. Hopefully this will save someone else some time and frustration.


SP2 CTP Install


While the Sedna CTP installed flawlessly, I was not so lucky when it came to installing SP2 (though Bo didn’t run into the following problems during his upgrade, he encountered some problems with the _reportlistener class and getting the new reporting enhancements to show up). During the install process it asked me for my installation CD at which point I dutifully placed my MSDN DVD in the drive and pointed the install towards “vs_setup.msi”, which it was apparently looking for. It spun for a while then came back with a message stating that what I had pointed it to was invalid. I tried a few more times to install, but was thwarted at every turn. Finally I took the “vs_setup.msi” from the DVD and copied it to my C:\ drive. I was obviously grasping at straws, but this finally did the trick and SP2 installed successfully.


IMPORTANT: You’ll want to backup your copy of VFP 9.0 SP1, runtimes from the Common Files\Microsoft Shared directory, and registry settings before attempting this on a development machine because there doesn’t appear to be a way to automatically rollback this service pack.



Here’s what was apparently going on underneath the covers in case this is of use to anyone at MS (NOTE: it was seeing the R:\vs_setup.msi that gave me the idea to copy it to my C:\ drive)…


MSI (c) (58:10) [03:27:03:531]: SOURCEMGMT: Now checking product {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
MSI (c) (58:10) [03:27:03:531]: SOURCEMGMT: Media is enabled for product.
MSI (c) (58:10) [03:27:03:531]: SOURCEMGMT: Attempting to use LastUsedSource from source list.
MSI (c) (58:10) [03:27:03:546]: SOURCEMGMT: Trying media source VFPPROD1;.
MSI (c) (58:10) [03:27:03:546]: Note: 1: 1706 2:  3: vs_setup.msi
MSI (c) (58:10) [03:27:03:546]: SOURCEMGMT: Processing net source list.
MSI (c) (58:10) [03:27:03:546]: Note: 1: 1402 2: UNKNOWN\Net 3: 2
MSI (c) (58:10) [03:27:03:546]: Note: 1: 1706 2: -2147483647 3: vs_setup.msi
MSI (c) (58:10) [03:27:03:546]: SOURCEMGMT: Processing media source list.
MSI (c) (58:10) [03:27:03:546]: Note: 1: 1706 2: -2147483647 3: vs_setup.msi
MSI (c) (58:10) [03:27:03:546]: SOURCEMGMT: Processing URL source list.
MSI (c) (58:10) [03:27:03:546]: Note: 1: 1402 2: UNKNOWN\URL 3: 2
MSI (c) (58:10) [03:27:03:546]: Note: 1: 1706 2: -2147483647 3: vs_setup.msi
MSI (c) (58:10) [03:27:03:546]: Note: 1: 1706 2:  3: vs_setup.msi
MSI (c) (58:10) [03:39:17:281]: SOURCEMGMT: Trying source R:\ENGLISH\VFOXPRO9.0\VS_SETUP.MSI.
MSI (c) (58:10) [03:39:17:312]: Cloaking enabled.
MSI (c) (58:10) [03:39:17:312]: Attempting to enable all disabled priveleges before calling Install on Server
MSI (c) (58:10) [03:39:17:359]: SOURCEMGMT: Resolved source to: ‘R:\ENGLISH\VFOXPRO9.0\’
MSI (s) (60:C0) [03:39:17:312]: Running as a service.
MSI (s) (60:A4) [03:39:17:312]: Entering CMsiConfigurationManager::SetLastUsedSource.
MSI (s) (60:A4) [03:39:17:328]: Specifed source is already in a list.
MSI (s) (60:A4) [03:39:17:328]: User policy value ‘SearchOrder’ is ‘nmu’
MSI (s) (60:A4) [03:39:17:328]: Adding new sources is allowed.
MSI (s) (60:A4) [03:39:17:328]: Set LastUsedSource to: R:\ENGLISH\VFOXPRO9.0\.
MSI (s) (60:A4) [03:39:17:328]: Set LastUsedType to: m.
MSI (s) (60:A4) [03:39:17:328]: Set LastUsedIndex to: 1.
MSI (s) (60:F4) [03:39:17:359]: SOURCEMGMT: Now checking product {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
MSI (s) (60:F4) [03:39:17:359]: SOURCEMGMT: Media is enabled for product.
MSI (s) (60:F4) [03:39:17:359]: SOURCEMGMT: Attempting to use LastUsedSource from source list.
MSI (s) (60:F4) [03:39:17:375]: SOURCEMGMT: Trying media source R:\.
MSI (s) (60:F4) [03:39:17:375]: Note: 1: 2203 2: R:\vs_setup.msi 3: -2147287038
MSI (s) (60:F4) [03:39:17:375]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
MSI (s) (60:F4) [03:39:17:375]: Note: 1: 1706 2: -2147483647 3: vs_setup.msi
MSI (s) (60:F4) [03:39:17:375]: Note: 1: 1706 2:  3: vs_setup.msi
MSI (s) (60:F4) [03:39:17:375]: SOURCEMGMT: Failed to resolve source
MSI (s) (60:F4) [03:39:17:390]: Transforming table Error.
MSI (s) (60:F4) [03:39:17:390]: Transforming table Error.
MSI (s) (60:F4) [03:39:17:390]: Note: 1: 2262 2: Error 3: -2147287038
MSI (c) (58:10) [03:39:17:406]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg


My last gripe about SP2 is that I couldn’t find a list of the enhancements and fixes that were included in this CTP. It would be nice to have a list so that I could test the fixes and know that I have found all of the enhancements that were provided. Perhaps Milind or someone else at Microsoft could rectify this apparent oversight by publishing a list online or giving it to us in the form of a txt file the way they did for the Sedna CTP. Just a thought.


MY Namespace


I had a couple of problems getting the MY namespace stuff working. First off you’ll want to run the My.app that is included in the CTP. This will install the MY namespace stuff (sets it up so Intellisense works – Doug Hennig is a master with Intellisense). Once My.app was done running I figured I could do something like the following…


LOCAL x as My
x = NEWOBJECT(‘My’, ‘my.vcx’)
?x.Computer.ComputerName


However, there were two problems with that being run in the IDE. First of all there is a select statement in the AddMembers function of the MyBase class that is in My.vcx that expects SET ANSI OFF. This can be fixed by replacing all of the code in that AddMembers function with the following…


* Add all member objects registered in the My table.

local lnSelect, ;
    lcNameSpace, ;
    lnLen, ;
    lcCursor, ;
    lcMember, ;
    lcLibrary
    
* Create a cursor of all objects in this namespace.

lnSelect = select()
lcNameSpace = upper(This.cNameSpace) + ‘.’
lnLen = len(lcNameSpace)
lcCursor = sys(2015)

select * from __MY where LEFT(upper(MEMBER),lnLen) = lcNameSpace and not empty(CLASS) and ;
    not deleted() into cursor (lcCursor)

* Go through the members, adding any that are directly within this namespace
* (for example, if this is “My”, we‘ll add “My.Computers” but not
* “My.Computers.Audio”).

scan
    lcMember = alltrim(substr(MEMBER, lnLen + 1))
    lcLibrary = fullpath(alltrim(LIBRARY), This.ClassLibrary)
    if at(‘.’, lcMember) = 0 and file(lcLibrary)
        This.NewObject(lcMember, alltrim(CLASS), lcLibrary)
    endif at(‘.’, lcMember) = 0 …
endscan
use
select (lnSelect)


The other problem is that because the My classes use the NewObject function My.vcx must be in the path. This can be worked around in the IDE by executing something along the lines of “SET PATH TO [C:\PROGRAM FILES\MICROSOFT VISUAL FOXPRO 9\SEDNA OCTOBER CTP\MY\] ADDITIVE” in the command window (thanks to Bo Durban for this workaround).


Once these fairly trivial problems were overcome, the MY namespace stuff for VFP worked really good. There’s even a builder included which you can check out by opening on of the classes, right-click on it, and then select “Builder” from the context menu. MY namespace is a great example of a useful set of classes that can and will be expanded on by the VFP Community. It even comes with its own help file, My.chm. Good documentation is always appreciated at this end.


Database Explorer


The Database Explorer ran flawlessly and one need only look into the Options area of it to see how extendable and modifiable it is. I believe this is the work of Rick Schummer. There were a couple of trivial things that should be noted when trying to run, modify and rebuild this project. First on the runquery form there is a cmdrun button that is missing a run.bmp picture. I found one to replace it in xsource (my path was… C:\Program Files\Microsoft Visual FoxPro 9\Tools\xsource\VFPSource\Wizards\wzapp\bmps\run.bmp). Second, the project still has the Code References files in it (dataexplorer_ref.dbf, dataexplorer_ref.FPT) from whenever Rick or someone at MS was last searching on it. These should be removed. And lastly, if you want the dataexplorer screen to be dockable when it comes up make sure to right-click on the title bar and select “Dockable” from the context menu. This only needs to be done once as the Database Explorer will save and restore your settings for this.



Overall the Database Explorer worked well for me and it easily connected to SQL Server 2005 on my development machine. There is a lot to try out and play with in this application, and I have hardly given it a full physical yet. It does appear to rely on DMO which has be deprecated in favor of SMO, but my feelings on that is that for the time being DMO provides like functionality and why introduce a .NET dependency that doesn’t need to be there right now.


SQL Server Upsizing Wizard


This wizard successfully upsized a few VFP databases at this end and a quick look at the databases in SQL Server showed that it had done not only a faster job of upsizing but a much better job of it. One thing to note when modifying or rebuilding this project in the IDE is that there is a missing/superfluous reference to a bulkxmlload.prg in the project. This reference should be removed.



Reporting Enhancements


Part of SP2, I haven’t yet had time to play with all the enhancements that have been provided, but below are a few screen shots to give you an idea of what they are (these are from the Field Properties dialog that comes up when you add or modify a field on a report)


Dynamics appears to provide a way for us to dynamically change the color and/or text of a report field.




On the Advanced tab there are a whole host of Properties that I haven’t played with yet and an easy to use object rotation feature that I did try out and it appeared to work pretty good. Most of these enhancements appear to be designed to take some of the grunt work out of advanced reporting in VFP. This should definitely be a production booster for any VFP developer that is need of these advanced reporting features.



Others Enhancements (not shown above)


Bo also reports that there are other new property pages available that Visual FoxPro developers interested in advanced reporting features would do well to check out.



  • Report Properties has a Document Properties tab
  • Label Properties has an Advanced tab
  • Rectangle Properties has Dynamic and Advanced tab
  • Image properties has Dynamics and Advanced tab

That’s all for now


Well, I’ve run out of stuff to talk about and show from the October CTP. I hope that this blog entry has served to pique your interest in the latest Visual FoxPro CTP (download it, work with it, and provide feedback online). Hopefully it saved you some time getting it up and running as well. Overall I was pretty pleased with this CTP and look forward to more of the same. Between Sedna, SP2, and VFPX (more announcements about and activity on VFPX are coming soon), the future of Visual FoxPro is very bright. Special thanks to the Microsoft Visual FoxPro Team, the sub-contract programmers, and the Visual FoxPro Community for their contributions to this latest evolution. Until next time… Visual FoxPro Rocks!