====================================== FoxPro Developers Network of San Diego ====================================== FoxDev TipsLetter #00-05 April 27, 2000 Website: Editor: ---------------------------------------------------------------------- CONTENTS: * Calendar * Tech Tips: You Can't See Into An Exe Barbara Peisch The ActiveProject Object Steve Settimi Debugging Reports Barbara Peisch Where Do I Find...? * Other Stuff: VFP Training in San Diego Steve Settimi Who's Problem Is It? Dan Covill Building Large Websites with VFP The $150 Million Buzzword Robert Glass FPDN Website Dan Covill Consulting Solutions Group * Administrivia ====================================================================== CALENDAR: We alternate meetings between Escondido and Sorrento Mesa. All meetings are at 7:00 pm. May 3 - Escondido ----------------- Kristyne McDaniel will be showing us how to implement configurable toolbars. June 7 - Sorrento Mesa ---------------------- Tim Daly will be showing us some OLE automation. July 5 ------ This will be a members tips and tricks presentation. If you have a tip or trick you would like to present, reply to this e-mail, or contact Art Bergquist at 760-740-0428. August 2 -------- Board member Dan Covill will be presenting some ways to "package" code to reduce the number of files in your apps. Sept 6 ------ Board member Barbara Peisch will be talking about using Steven Black's INTL toolkit for creating multi-lingual apps, with a special emphasis on his Message Service. Oct 4 ----- Board member Art Bergquist will show us how to use dynamic controls in a grid. Escondido meetings are at Bergelectric, 2222 Meyers Avenue. Take the Nordahl exit from Highway 78 (west of I-15). Head South. Right on Meyers Ave, first right past Mission. It's a one-story building on the right (there's no sign). 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. ====================================================================== TIPS ====================================================================== YOU CAN'T CALL INTO AN EXE. by Barbara Peisch Don Ellis had a problem he couldn't figure out. One one of his forms he had an instance of a button class whose click method called another (SCX based) form. This worked fine, as long as the program was run in development mode with all the source files present. When compiled to an EXE, however, VFP reported that it couldn't find the SCX file. The SCX was compiled into the EXE, but Don found that he still had to have it present in the directory to avoid the error. Why? As it turns out, this problem was caused by the fact that the VCX library was NOT included in the EXE. (They [Ellis' client] do this so they can send updates without having to send out a whole new EXE.) But the button on his form is executing the default click(), with code that is actually in the VCX. Since the VCX wasn't part of the EXE, the click code wasn't able to search the EXE to locate the form! [A more general statement is that an EXE is so tightly wrapped that you can't see into it from outside. If you're going to call something that's inside an EXE, you have to be inside it yourself. Looked at another way, an EXE is an object that exposes none of its methods. DC] Barbara Peisch is the principal of Peisch Custom Software, and the Treasurer of FPDN San Diego. ---------------------------------------------------------------------- THE ACTIVEPROJECT OBJECT by Stephen Settimi _VFP.ActiveProject is a reference to any open project in VFP. The entire set of all opened projects can be referenced by looping through the collection of opened projects by querying _VFP.Projects[n]. The entire collection can be looped through using a standard syntax like: FOR EACH oneproject in _VFP.Projects. The "oneproject" then becoming a reference to the current project in the loop. For each individual project ("oneproject" or _VFP.ActiveProject), the PEMs can be accessed and manipulated in a variety of ways. You can Type or ascertain anything about the files included in the project (forms, reports, class,libraries, etc.), thus allowing you to manipulate them as you wish. This is a very handy feature that can be built into a method of the project hook, like the BeforeBuild method. Noteworthy, one of the properties of these files is "Exclude". This property allows you to systematically exclude or include any of the files in the project. You can programmatically add or delete files as well. All of this becomes very handy if you like to distribute your app as a collection of independent object files that can be updated outside of the EXE. Stephen Settimi is an independent trainier and developer, and a former FPDN Board member. ---------------------------------------------------------------------- DEBUGGING REPORTS by Barbara Peisch Debugging reports has always been a pain for me, because when the report has an error, it never tells you which object had the error. You just get a dialog that says something like "Syntax error", and the report doesn't run. Well, thanks to Christof Lange and Frank Cabazon, I've found a better way! Christof told me that if I run the report from within the report designer, by right-clicking on a section of the report that doesn't have any objects and selecting "Preview" from the pop-up menu, that it will tell me where the error was. Sure enough, I still get the same dialog with the error message, but after clicking OK I'm in the properties window for the offending object. "This is really useful", I said, "but many of my reports depend on memory variables and cursors that don't exist when I'm in the report designer." That's when Frank jumped in with this simple but elegant solution: at the point in your program where you call the report, just comment out that line and add a new one that says "MODIFY REPORT" instead. That way, you have the environment you need to run the report, but you're in design mode, so you can still right-click and select the Preview option. Once you've finished debugging your report, comment out the MODIFY REPORT line, and un-comment the REPORT FORM line. ---------------------------------------------------------------------- WHERE CAN I FIND...? A (semi) permanent list of places to look for technical help when you get blind-sided by the latest urgent requirement. We don't give specific URLs for MSDN articles because (a) they're too long and (b) they change too often! ------------------------------- MSDN ON LINE: There's a ton of stuff here, look at the Magazines tab, and read some of the regular columns. MSDN Library Look in Technical Articles | Visual Studio | Visual FoxPro 3-Tier Apps: MSDN Library: "Building Three-Tier Client/Server Applications with Visual FoxPro" DNA (Distributed interNet Architecture): MSDN On-line: "Top Windows DNA Performance Mistakes and How to Prevent Them" MTS: Microsoft Transaction Server MSDN Library: "Microsoft Transaction Server for Visual FoxPro Developers" ODBC: MSDN Library: "Using Visual FoxPro to Access Remote Data" VS Installer: MSDN Library: a. "Using Visual Studio Installer for VFP 6.0 Applications" b. "VFP 6.0 and VS Installer Tutorial" Windows General XML - What's New in XML for Microsoft Windows 2000 [Contributions solicited. DC] ====================================================================== OTHER STUFF ====================================================================== VFP TRAINING IN SAN DIEGO by Stephen Settimi I'm puttin on a two day VFP training session in San Diego, June 29th - June 30th. The training is targeted to "New-to-VFP" programmers and other intermediate programmers interested in learning the nuances of the programming language, some new techniques and the inside workings of VCXs, project manager/hook, etc. There will be two 1/2 day and one 1 1/2 day sessions. Anyone interested in attending should refer to: ---------------------------------------------------------------------- WHOSE PROBLEM IS IT? by Dan Covill (Did you ever feel frustrated when a client won't face up to a problem? (Of course not!) A few years ago, a client of mine started making - and using - multiple copies of his data. I ended up writing him a memo that ended with the following paragraph.) "COMMENT: The bigger a database is, the quicker it goes to hell. If there is data in more than one place, the copies are never the same. If procedures aren't written and managers don't follow up, things won't get done. In my opinion, you have a potentially serious problem here. While my recommendation is that WE implement a solution, the problem is and remains YOURS, not mine. If [client] agrees that it's a problem, and wants it solved, we can work together to solve it. If [client] doesn't agree that there is a problem, or doesn't want to spend the money, or the time, or the energy, or the management attention, or whatever, to solve it, then it doesn't much make a rat's ass whether I think it's important or not. Database management isn't just a technical problem, it's a MANAGEMENT problem, and it can't be solved by programming alone." [No, I didn't get fired, but I was sort of hoping to be. DC] ---------------------------------------------------------------------- BUILDING LARGE WEB SITES WITH VFP If you're working on a large VFP application, or you're just interested in the topic, you might take a look at the following article by Rick Strahl: -------------------------------------------- Example: Egghead.com's Surplus Direct Site Site Statistics Site Configuration Web Development Issues Performance Data Optimization To SQL or not to SQL Code Optimization Web Site Optimization Web Server Optimization Security Scaling applications Visual FoxPro and MultiThreading Apartment Model Threading in 6.0 Microsoft Transaction Server Pool Managers in Web Connection and FoxISAPI Scaling and Loadbalancing Scaling with multiple processors Scaling with multiple machines Scaling with redundant servers and IP routing The Development Process Team Development Source Control Integration of Code and HTML [I hear thru ProFox that business changes at Egghead have since changed and/or replaced parts of the system that Rick describes, but the discussion remains valuable. DC] ---------------------------------------------------------------------- THE $150 MILLION BUZZWORD DEBACLE [excerpts from an article by Robert Glass in the Communications of the ACM, August, 1999] "This is the story of a major software runaway project, the CS90 project. It happened at the Westpac Banking Corporation in Australia, where management wanted to leap forward from a collection of tired legacy systems to a new concept in banking software development. ... Westpac burned at least $150 million in the effort, and ended up with nothing to show for it except some worthless code and some tired and frustrated programmers. ... The new folks were interested in data modeling, artifical intelligence, and other trendy subjects....Before long, they had invented a whole new approach bo building banking software. For instance, there would be a Product Development Facility at which reusable business logic components would be built, and a System Development Facility in which application software would be glued together from those PDF components. There would be a "CS90 Engine" that would do the gluing. There would be a strong flavor of object-orientation, with "supertype classification schemes" to "formalize" the components. There would be heavy use of inheritance "to tie together the high-level supertypes through requirements to the lower-level design and implementation objects." There would be a "state machine model in which the operations can be viewed as functions applied to a defined set of data items." There would be "knowledge engineering" to "configure the necessary application systems from the components." (These quotes were from a slick, elegantly produced brochure prepared by Westpac as the project started.) "It was a classic example of two common human behaviors; a willingness to abdicate common sense when presented with a sure thing, and a failure to respond when faced with overwhelming evidence to the contrary." [Glass presented this (much longer) story as an example of the communications gap between academics and practitioners. He says, "Was it really so obvious that the buzzwords spelled doom for the project?", and concludes that his academic friends would answer, 'Of course not', but his practitioner friends would say, 'It certainly was.' ] ---------------------------------------------------------------------- THE FPDN WEBSITE We (that's a collective "we", Eric Lendvai is doing most of the work) are getting close on our new Website, complete with new graphics, our own domain, and all the good stuff. I had hoped to give you the new URL in this newsletter, but... Like all programming projects, it ain't quite done yet. Stay tuned... [DC] ---------------------------------------------------------------------- SOLUTIONS CONSULTING GROUP Solutions Consulting Group, at 6540 Lusk Blvd, is the host for our Sorrento Mesa 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 858-272-2448 Board of Directors: Eric Lendvai - President 760-734-4929 Art Bergquist - Vice Pres 760-740-0428 Claude Nikula - Secretary 619-615-6318 Barbara Peisch - Treasurer 760-729-9607 Dan Covill - Director 858-272-2448 Thad V'Soske - Director 619-544-9900 ----------------------------------------------------------------------