Visual Basic 6 Black Book: Indispensable Problem Solver with Cdrom
Authors: Steven Holzner
Venue:  (1998)

From the Book: Introduction Introduction Welcome to your Visual Basic support package. Thats what this book has been designed to be: your complete VB support package. Have we reached that goal yet? Its up to you to decide. If what youre looking for is not in this edition, well work hard to make sure its in the nextI encourage your suggestions. Please feel free to write. Well put in the time to make sure this book is the most complete one available on Visual Basic, edition after edition. This is the book we want you to come back to again and again. Ive used Visual Basic back before version 1 even came out publicly and have written many books on the program. I put Visual Basic to work for a very wide range of uses day after day; in fact, its is my favorite programming package of all, and it comes close to being my favorite program period. But Ive never written a book on Visual Basic as complete as this one and never included as many features, documented or undocumented, examples, and tips in one volume. This book has been designed to give you the coverage you just wont find in any other book. Other books often omit not only the larger topics, like deploying your program after youve created it and creating Help files, but also the smaller ones, like covering in depth just about every control that comes with Visual Basic, including the ActiveX controlsfrom the MS chart control to flat scroll bars, from the serial port comm control to the Internet transfer control. Reluctantly, I must admit that its impossible for one volume to be utterly comprehensive on the subject of Visual Basic (impossible because its not physically possible to bind a book that big yet), but were trying our best. Its true that some specialty books might have more coverage on a few topics, but if you want to see more on a particular topic, write in and well work seriously on adding more of that topic to the next edition. How This Book Works The task-based format we use in this book is the one most programmers appreciate because programming is a task-based business. Rather than reading about subjects in the order the author thinks best, you can go directly to your topic of interest and find the bite-sized nugget of information you need, such as opening an FTP connection, adding a Web browser to your program, supporting online user registration from Visual Basic, adding a method to an ActiveX control, creating an error handler, flipping or stretching an image, opening an RDO database connection, playing CDs from the computers CD-ROM drive, and literally hundreds of other topics. And best of all, theres a working example in code for almost every programming topic in the book. The actual process of programming is not abstract; its very applied. So instead of vague generalities, we get down to the specificsall the specificsthat give you everything you need to understand and use Visual Basic. In the old days, programming books used to be very top-down, with chapters on subjects like conditional branching, loop structures, variable declarations, and so forth. But who sits down to program by saying, "Im about to create a conditional program flow branch"? Instead, programmers are more interested in performing useful tasks, like adding buttons, menus, list boxes, or toolbars to a window; creating graphics animation; creating dialog boxes; creating setup programs; working with files; supporting online Help; and so on. And this book is written for programmers. Because this book is written for programmers, each chapter is broken up into dozens of practical programming tasks. After selecting the chapter you want, you can turn to the table of contents, or to the first page in that chapter, to find the task youre interested in. Hundreds of tasks are covered in this book, chosen as those that programmers most want to see. In addition, this book is filled with nearly 800 examples, covering just about every Visual Basic programming area there is. These examples are bite-sized and to the point, so you dont have to wade through a dozen files trying to understand one simple topic. And theyre as comprehensive as we could make them, covering every programming area in the book. Besides programming tasks and examples, the book also has overviews designed to bring all the pieces together into a coherent whole, giving you the entire picture. The first chapter is designed specifically to give you an overview of Visual Basic itself, along with some of the best programming practices to use, including those recommended by Microsoft. Every subsequent chapter starts with an overview of the subject it covers before digging into the specifics, making sure we never get lost in details. Well also see discussions on best programming practices, program design, program testing, what makes a professional Windows application professional, and much more, as befits a book that wants to be your complete Visual Basic support package. In addition, the CD that accompanies this book holds the code for all the major projects we develop. To open and use a project, look for the Visual Basic project file (for example, browser.vbp for the browser project) and open that project file with Visual Basic. Besides the code from the book, note that the CD has hundreds of megabytes of tools and software, ready for you to use. Whats In This Book Just about everything we could write about Visual Basic is in this book, and thats a lot of ground to cover. From language reference to ADO database handling, from creating Web browsers to dragging and dropping data across applications, from email applications to multimedia players, from creating ActiveX controls and ActiveX documents to setup programs, its all here. Heres some of what well see how to create in this book:  ActiveX controls  ActiveX documents  ADO, DAO, and RDO database applications  Multimedia AVI, MPG, WAV, and MID players  CD players that play CDs from the computers CD-ROM drive  Bitmapped menu items  Full Web browsers  Pie charts, line charts, bar charts, and others  Code clients that call methods in programs like Microsoft Excel  Code components (OLE automation servers)  Graphics animation  Applications that use the Windows Common Dialogs  Customized toolbars with embedded controls like combo boxes  Data entry forms  Database editing applications  Direct connections to the Windows API  Direct connections to code written in Visual C++  Drag/drop operations  Graphics applications that draw arcs, circles, rectangles, lines, and more  Email applications  Error handlers  Applications that use the printer  Word processor applications  File handlers for text and binary data  FTP applications  Dialog boxes  Windows Help files  MDI applications  Pop-up menus activated with right mouse clicks  Application deployment  HTTP applications  Image handling: blur, emboss, engrave, flip, sweep, stretch images, and more  OLE applications  Applications that use the Windows Registry  List views and tree views  Applications that create controls at runtime  Mouse capture  OLE drags (dragging data between applications)  Online user registration  Picture clip applications  Setup programs  Screen capture  Spreadsheets  Status bars and toolbars  Tab strips, progress bars, and others Thats just some of whats coming up. Visual Basic is a very large topic, and the topics well cover number in the hundreds. And if you have suggestions for more, please send them in. What Youll Need To use this book profitably, you should have some experience with Visual Basicnot necessarily a lot, but enough to get through Chapter 1 without trouble. We assume you have some familiarity with the essentials of Visual Basic in this book, although those essentials are not very hard to pick up. If you do have trouble with Chapter 1, you might take a look at an introductory book before proceeding. As far as software goes, just about all you need to use this book is already in Microsoft Visual Basic (well use version 6 in this book). Visual Basic comes with an enormous set of tools and resources, and well have our hands full putting them to work. We try to be as self-contained in this book as possibleeven creating the database files well use in examples with Visual Basic itself, not with a database application. The graphics files we use in various examples are on the CD, and the multimedia files well play in our multimedia examples come with Windows. Some of our OLE and OLE automation examples use Microsoft Excel, but Excel is not essential to those examplesany OLE server and OLE automation server program will do. Note that to use email from Visual Basic, you must have the Windows MAPI system installed (as represented by the Inbox icon on the Windows desktop). Where can you go for additional Visual Basic support? You can find Visual Basic user groups all over, and more are appearing every day. You can also find Visual Basic information (and advertising) at the Microsoft Visual Basic home page at www.microsoft.com/vbasic/, free Visual Basic downloads at http://www.microsoft.com/vbasic/download/, and technical documents (white papers) at http://www.microsoft.com/vbasic/techmat/. Although the content varies in accuracy, there are many Usenet groups dedicated to Visual Basic as well, but be careful what you read theretheres no guarantee its accurate. About two dozen of those groups are hosted by Microsoft, including:  microsoft.public.vb.bugs  microsoft.public.vb.addins  microsoft.public.vb.controls  microsoft.public.vb.database  microsoft.public.vb.installation  microsoft.public.vb.ole  microsoft.public.vb.ole.automation  microsoft.public.vb.syntax Other, non-Microsoft groups include some of these popular Usenet forums:  comp.lang.basic.visual  comp.lang.basic.visual.3rdparty  comp.lang.basic.visual.announce  comp.lang.basic.visual.database  comp.lang.basic.visual.misc And that all the introduction we needits time to start digging into Visual Basic. As weve said, we intend this book to be your complete support package for Visual Basic, so, again, if you see something that should be covered and isnt, let us know. In the meantime, happy reading!