====================================== FoxPro Developers Network of San Diego ====================================== FoxDev TipsLetter #99-5 MAY 34, 1999 Website: Editor: ---------------------------------------------------------------------- CONTENTS: * Calendar * Review of Tim Daly's Presentation Steve Settimi * Tech Tips: Sys(3052) Avoids Locking Errors Eric Lendvai Subclassing Internet Explorer John Harvey Creating Your Own Collections * Other Stuff: Installing(?) Windows 2000 Dan Covill Customizing the BSOD A. Nonymous Why Windows 2000 is Late Consulting Solutions Group * Administrivia ====================================================================== CALENDAR: We are now alternating meetings between Escondido and Sorrento Mesa. All meetings are at 7:00 pm. June 2 Escondido Eric Lendvai will talk about Builders. July 7 Sorrento Mesa Barbara Peisch will report on what happened at DEVCON August 4 Escondido Art Bergquist will show us a tool called Power Help Sept 1 Sorrento Mesa Claude Nikula will demonstrate managing SQL Server 7.0 from VFP. Escondido meetings are at Bergelectric, 2222 Meyers Road. Take the Nordahl exit from Highway 78 (west of I-15). Head South. Right on Meyers Rd, first right past Mission. Sorrento Mesa meetings are in the PS Business Center, 6450 Lusk Blvd. From the Lusk Blvd driveway, go straight back to the furthest corner of the rear bldg and park. The conference room is upstairs over the Fitness Center. ---------------------------------------------------------------------- MANAGING A WAN USING AN ACTIVEDOC CLASS At the May 5th meeting Tim Daly presented a demonstration of the ActiveDoc Class of VFP which essentially wraps a VFP application within an HTTP Internet Browser capable plug-in. This done by adding the ActiveDoc class to a project and calling a main program or form from the Run method of the ActiveDoc Class. The class is also the main program used for the project build. Tim's presentation, originally designed for MCI was a hub and route mapping of the entire MCI network (For the demonstration Tim swapped out MCI and used a bogus Airline airport/route scenario). The VFP APP is opened in a browser, IE works easiest but Netscape's browser seems to work as well with minor tuning. In the lower part of the browse window is a VFP Top-level form showing a site map of the USA with color coded dots at key cities (nodes). A small, movable, rectangular shape view finder can be moved over any area of the map, and when clicked brings up a vector map behind the Top-level form filling the remaining background area of the browser window with an exploded view of the routes and any node. The nodes are shown using command buttons. The buttons and lines are active objects that when clicked bring up small forms with city or route specific data. Included in the display are exact distance calculations using algorithms based on longitude/latitude coordinates from a lookup table. What added to the complexity of the display is making a determination as to exactly which line object the mouse is clicking on. Because you know, the line object is actually contained within an invisible frame and to show crisscrossing vector lines on such a display means that there could be many line objects overlaying each other in Z-order. How is it determined which is to have focus? Think Pythagorean [sic] and algebraic calculations against the immediate set of objects in proximity to the mouse. Not easily calculated but keenly calculated nonetheless. Of particular fascination by a small inquisitive clutch of the members was the use of a PageFrame in the bottom level form (the one that shows the exploded view of the hub/route layouts in the background of the browser). A little known aspect of the PageFrame class in VFP is that it can actually exceed the size of a form and so is used to plot the multitude of coordinates of the network hub/route network. Review by Steve Settimi ====================================================================== TIPS ====================================================================== SYS(3052) AVOIDS LOCKING ERRORS Eric Lendvai Use the SYS(3052) function to avoid "Record Not Available" errors. Details can be found in the Microsoft Knowledge Base at SUMMARY The SYS(3052) function helps prevent the scrolling error message "Record Not Available, please wait" by specifying whether or not Visual FoxPro uses the SET REPROCESS settings when attempting to lock an index or a memo file. This article explains how to use the SYS(3052) function in multiuser applications. ---------------------------------------------------------------------- SUBCLASSING INTERNET EXPLORER John Harvey (from "Fox Footnotes", February, 1999 Page 6) Newsletter of the Rocky Mountain Fox User Group Subclassing IE *:************************************************************* *: Procedure File YAHOO.PRG *: John Harvey *: Documented using Visual FoxPro Formatting wizard version .05 *:************************************************************* *: YAHOO.prg is a simple program to demonstrate subclassing *: the Internet Explorer. IF type ('oie')='U' PUBLIC oie oie=createobject('internetexplorer.application') ENDIF oie.navigate('http://www.yahoo.com/search/people') ** delay for 5 seconds to allow yahoo time to find the records lntime=seconds() DO while seconds()-lntime< 6 ENDDO oie.document.script.window.document.forms(1).firstname.value; ="john" oie.document.script.window.document.forms(1).lastname.value ; ="harvey" oie.document.script.window.document.forms(1).city.value = "memphis" oie.document.script.window.document.forms(1).state.value = "tn" oie.document.script.window.document.forms(1).submit() ** bring the browser to the top oie.visible= .t. ---------------------------------------------------------------------- CREATING YOUR OWN COLLECTIONS Author unknown (from "Fox Footnotes", February, 1999 Page 6) Newsletter of the Rocky Mountain Fox User Group To create a collection in VFP6, just use something like this: dimension aForms[3] for nCnt = 1 TO 3 aForm[nCnt] = createobject('form') endfor Or if you want the collection to be contained inside an object: Create an Array Property by naming a property "collection[1]", then dimension the property anytime you need more then one item in the collection. In this Array Property put object references instead of data. What if you want to make a collection of all the labels on a form so you can control them with FOR EACH? Put the following code into an event of a form holding 13 subclassed label controls. public aLbl dimension aLbl[13] for I = 1 to alen(aLbl) ** get the object reference here oTemp = eval("thisform.Lblsv"+alltrim(str(I))) aLbl[I] = oTemp endfor [*** See note below. DC] In some other event of choice, put this code: CurLeft = 15 CurTop = 15 for each Lblx in aLbl Lblx.left = CurLeft Lblx.top = CurTop Lblx.backcolor = rgb(0,255,0) && green (!) CurLeft = CurLeft+5 CurTop = CurTop+5 endfor This form will not close however because the form has object references that were created in the form, so you must put: store .F. to aLbl in the QueryUnload event of the form, and make your exit button call the QueryUnload eventcode to make it work. [Editor's note: The code to create aLbl assumes that his label control subclass is "LblSv" and that the default naming was used for the 13 instances, so that "LblSv1" thru "LblSv13" will work. But there are far too many ways for this code to fail. It breaks if you change the subclass, or if you change any label's name, or if you don't have exactly 13, etc. etc. Something like the following would be MUCH safer: nLabels = 0 *-- Make aLbl a collection of all labels for each oTemp in thisform.Controls if oTemp.BaseClass = 'Label' nLabels = nLabels + 1 dimension aLbl[nLabels] aLbl[nLabels] = oTemp endif endfor This code doesn't care how many there are or what they're called. Besides, the article is about collections, why not use them in the sample code? Dan Covill] ====================================================================== OTHER STUFF ====================================================================== INSTALLING(?) WINDOWS 2000 by Dan Covill Some weeks ago I signed up for the Windows 2000 "Corporate Preview Program", which means that you get to pay for testing Beta 3. (Yes, I know, I'm too old to be that stupid, but there's one born every minute and I just happen to be the latest one.) It came yesterday, so I set out to install it. I may be naive, but I'm not totally stupid, so I "installed" it on my second machine, the one I can live without. Good choice. The package includes a W2000 Professional disk (i.e., Workstation), a W2000 Server disk, a two-disk "Evaluation and Deployment Package", and two copies of a "Corporate Preview Guide" (i.e., installation info and What's New). Read the book. Bob is alive and well in W2000 - Microsoft terminology gets more cutesy-poo with each release. "My Computer" and "My Documents" apparently didn't sound dumb enough, they've added "My Pictures" and "My Network Places" folders also. The latter includes something called "Computers Near Me"! And they have the nerve to call this "professional"? Gag me with a spoon! Decided to install it replacing NT 4.0 (this is a dual-boot machine). Started about 5 pm. It said "copying files...". Ten minutes later it rebooted, displayed a pretty W2000 logo, and said "please wait..." After another ten minutes it said "Wait while setup detects your devices, such as the keyboard and mouse..." Seventeen minutes later, at 5:40, the "blue screen of death" appeared. Restarted setup, on the theory that if you don't know what's going on try it again. Much quicker, it only took 19 minutes to get to the blue screen of death. A nasty question occurred to me. This machine has BOTH Win 95 and NT on it - which one were they replacing? I was able to reboot into Win 95 successfully, which answered the question. But what if I had _wanted_ to replace the Win 95 instead of the NT? I don't think it would be possible. The blue screen message is interesting: "DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATION" and the program is (are you ready?) "sermouse.sys". Sheesh! Checked the Windows 2000 Beta 3 web site. Not encouraging, lots of newsgroup traffic about crashes. W2000 definitely will not run with ACP (power management) enabled, and there are LOTS of hardware problems. But it's consistent - when it stops it stops for good. Tried installing two more times, using "Complete Install" and "Repair Existing Installation". One took 27 minutes and the other 35 minutes. Same blue screen. There are problems even if it does install and run. Setup displayed a window telling me that (a) it didn't think it had drivers for my Ethernet SN2000 (i.e., default standard) card, (b) my Logitech mouse drivers were not compatible, (c) my McAfee Virus Scan (the latest version) was incompatible and would be disabled, and (d) I would have to uninstall pcAnywhere (again, the latest version) before setup would even continue. It's interesting how often Microsoft's competitors show up on these lists of incompatibilities... Right now, I'm going to reinstall NT 4.0, so I can see what appeared on my NTFS disk partitions (can't see them at all in Win 95). Then I may erase my Logitech mouse drivers (and hack the Registry to remove all references to Logitech) and try installing from scratch. (I do this for two reasons; it feels so good when I stop, and I want to be sure and get my sixty bucks worth.) But if Windows 2000, after three years of development, can't handle a serial mouse, the future seems bleak indeed. Dan Covill Middleton Consulting Inc. (619)272-2448 ---------------------------------------------------------------------- CUSTOMIZING THE BSOD Anonymous In a surprise announcement today, Microsoft President Steve Ballmer revealed that the Redmond based company will allow computer resellers and end-users to customize the appearance of the Blue Screen of Death (abbreviated BSOD), the screen that displays when the Windows operating system crashes. The move comes as the result of numerous focus groups and customer surveys done by Microsoft. Thousands of Microsoft customers were asked, "What do you spend the most time doing on your computer?" A surprising number of respondents said, "Staring at a Blue Screen of Death". At 54 percent, it was the top answer, beating the second place answer "Downloading Pornography" by an easy 12 points. "We immediately recognized this as a great opportunity for ourselves, our channel partners, and especially our customers." explained the excited Ballmer to a room full of reporters. Immense video displays were used to show images of the new customizable BSOD screen side-by-side with the older static version. Users can select from a collection of "BSOD Themes", allowing them to instead have a Mauve Screen of Death or even a Paisley Screen of Death. Graphics and Multimedia content can now be incorporated into the screen, making the BSOD the perfect conduit for delivering product information and entertainment to Windows users. The Blue Screen of Death is by far the most recognized feature of the Windows (tm) operating system, and as a result, Microsoft has historically insisted on total control over its look-and-feel. This recent Departure from that policy reflects Microsoft's recognition of the Windows desktop itself as the "ultimate information portal." By default, the new BSOD will be configured to show a random selection of Microsoft product information whenever the system crashes. Microsoft channel partners can negotiate with Microsoft for the right to customize the BSOD on systems they ship. Major computer resellers such as Compaq, Gateway, and Dell are already lining up for premier placement on the new and improved BSOD. Balmer concluded by getting a dig in against the Open Source community. "This just goes to show that Microsoft continues to innovate at a much faster pace than open source. I have yet to see any evidence that Linux or OpenBSD even have a BSOD, let alone a customizable one." ---------------------------------------------------------------------- WHY WINDOWS 2000 IS LATE (unknown) [The following was in a discussion about the delays in release of Windows 2000. Unfortunately, I didn't get the writer's name. But I think he hits the nail pretty squarely on the head. DC] We shouldn't be surprised. Microsoft's Gates knows what he wants: like many dwellers on technology's leading edge, he wants computers to let him express new ideas and communicate them to others. Microsoft's employees, by and large, want what Bill wants. But there is a fundamental problem with this happy picture of talented people with vision, commitment, and resources. It's all right to have geniuses build systems for use by idiots, but the path from laboratory to marketplace needs to go through the proving ground of prudent engineering. Consider the first elevator: the person who first thought of throwing a rope over a branch, and pulling down to raise something up, was probably a genius -- at least, relative to those around him. But the first person who tried to duplicate the idea may well have wound up with a fractured skull when a rope slipped or broke. That's the difference between invention and design. Today, the essential concept of an elevator is almost buried -- desirably so -- in safety mechanisms. Genius may innovate, but engineering assimilates. Today, most of the intellectual capital invested in the idea of "an elevator" is spent on keeping the user from getting hurt. And elevators only do one thing. Microsoft Windows and Microsoft Office do many things, a growing number of things, a bewildering variety of things. At the same time that Microsoft is modifying the elevator, so to speak, to move sideways and to fly, they are trying (often halfheartedly) to add safety on instead of designing it in. The result is never as good as it needs to be. ====================================================================== SOLUTIONS CONSULTING GROUP Solutions Consulting Group, at 6540 Lusk Blvd, is the host for our meetings. But who are they, and what do they do? "Since its inception in 1993, Solutions Consulting Group has grown to more than 40 employees with over 65 active clients throughout Southern California. We are a Microsoft Certified Solution Provider Partner and a member of the Oracle Business Alliance Program." They do: Corporate Application Development Data Warehousing Network Services They work in FoxPro, VFP, VB, Access, SQL, and Oracle. They are looking for more employees and they do use contractors as well; contact Armando Andrade at if you're interested. For More Information... --------------------------Administrivia------------------------------- This newsletter is a service to members of the FoxPro Developers Network of San Diego (FPDN). The editor (Dan Covill) is solely responsible for the content, Barbara Peisch does the distribution. E-mail the editor YOUR tips, comments, complaints, and rebuttals. Editor: Dan Covill 619-272-2448 Board of Directors: Eric Lendvai - President 760-439-6617 Art Bergquist - Vice Pres 760-740-0428 Claude Nikula - Secretary 619-615-6318 Barbara Peisch - Treasurer 760-729-9607 Randy Barber - Director 619-670-7542 Steve Settimi - Director 619-262-5883 ----------------------------------------------------------------------