Exam Reviews

Acing VB Desktop Apps

To pass the new Visual Basic 6.0 Desktop exam, you need to know standard VB objects (forms and controls) and the events they fire, ADO, and how to debug and deploy.

You’ll find plenty of similarities between the Visual Basic Desktop exam and the Visual Basic Distributed Applications exam, which I helped review in the January issue. The primary difference: You won’t see scary Microsoft Transaction Server (MTS) or Internet Information Server (IIS) questions on this test.

The focus of this exam is building desktop applications. So you have to ask yourself, what makes up a typical desktop application? You have a user interface to handle input and output, data access, and data storage. These are all glued together by the Component Object Model (COM). Fling in a few questions about DHTML and Web questions, and you’re ready.

The focus for this exam consists of five areas:

  • General Visual Basic programming
  • User interface
  • Data access
  • Developing and using components
  • Debugging and deployment

I didn’t find data storage covered in this exam, though I had to know how to access and manipulate data sources. And, of course, you’ll be surprised with a sprinkling of miscellaneous topics, which I’ll cover last.

Visual Basic 6.0 Desktop Applications (70-176)
Reviewers’ Rating: “This is about building stand-alone desktop applications. Consider it like the Visual Basic 5.0 exam with coverage of new Visual Basic 6.0 features.”

Title: Designing and Implementing Desktop Applications with Microsoft Visual Basic 6.0.

Number of questions in reviewed version of exam: 70.

Time allowed: 90 minutes.

Current Status: Live as of December 1998.

Who should take it? Developers building full-featured programs to run on end-user computers. This exam can be used as an elective for the MCSD track.

What classes prepare you? Course 1013: Mastering Microsoft Visual Basic 6 Development. Available as instructor-led and self-study course.)

Know Programming

You’re going to need a solid background in VB in order to pass this exam. If you’ve already taken and passed the Visual Basic 5.0 exam, this should be a piece of cake. When the exam shows you code snippets, you’ll want to make sure you understand VB syntax.

The Appearance of Things

The typical desktop application needs to handle the user’s input as well as display information to the user. For the test, you’ll need to study up on forms, controls, and events.

For the forms, know the load and unload methods, terminate and activate. Also, know how to do popup menus and add and remove menu items and controls to a form object. Study the different collections that are associated with the form (the Controls collection, for example).

For the controls, expect questions pertaining to the standard VB controls: Status Bar, Progress Bar, Text Box, Image List, button, label, Tabbed Dialog Control, and so on. Become familiar with the properties and events that they have. A few that come to mind are CausesValidation, Validate, GotFocus, LostFocus, Change, Key, and Index.

Tip: This portion of the test has the most code snippets. I’d recommend spending some time coding some samples using the controls on a standard executable.

Data Access

If your programs run in a business environment, they’ll probably require some type of database to store your application’s data. As of late, ADO 2.0 (ActiveX Data Objects) is the hot data access tool. VB 6.0 has enriched database capabilities. It includes the new ADO data control, the Data Environment Designer, the Data Report Designer, the Hierarchical Flexgrid control, nested command objects, and other cool database features. All of these use ADO for data access.

The exam covers the various cursor types—Forward Only, Static, Dynamic, and the like. Know when to use them. Would you always need to read and write to the recordset? Is it for a lookup table only? Also be familiar with recordset locking options.

Know the different ADO objects, command, connection, and the recordset. Likewise, have a fundamental understanding of Error, property, parameter, and filed objects. Know how to execute a SQL statement and a stored procedure.

Know how to use the ADO data control, refresh the data, and set the data member and data source.

Know how ADO events work and what they’re used for.

Tip: There’s a great article by Dan Fox covering the old ADO in the July 1998 issue of Visual Basic Programmer’s Journal called “ADO 2.0 Adds Flexibility, Performance.”

Developing Components

You’re going to need to know how to develop component-based solutions for your desktop applications. COM is the glue that puts all of the components together. VB has several ways to create COM components. You can create an ActiveX DLL or control (in-process), an ActiveX .exe (out-of-process), and an Active Document.

Be familiar with the project options of each type. VB 6.0 includes a new tab for the project options relative to how your project will be debugged. Get to know it.

Expect coverage of the instancing of these objects, early binding vs. late binding, what the “WithEvents” keyword is used for, and how to work with COM. Know the basic interfaces Iunknown and IDispatch.

Tip: COM permeates the exam. It’s inherent in designing, developing, and debugging the typical VB desktop application. The more you know about COM, the better off you are.

Debugging and Deploying

You’ll need to know how to test and debug your desktop application thoroughly, as well as how to deploy it. Unfortunately, both of these usually happen last on a project.

Understanding this stuff can pay. I’ve just spent several days trying to install software to develop a demonstration for a conference. I spent more time installing, configuring, and re-configuring the software than I did developing it. I didn’t just install the software—I danced for it, whispered softly to it, and begged it to work. (It was quite disruptive in the office.) Deployment is important in the real world as well as this exam! Expect high-level deployment planning questions, such as this example I’ve made up:

You’ve created “Hot Dawg,” the Super Duper Desktop Application. You compile your main program and then you compile your support DLL. You load up a setup script into the Package And Deployment Wizard to create a setup program. You test it on your machine, and it works great. When you give it to your boss to test on his machine, your application fails, saying that it can’t create a component. What will you tell your boss?

  1. “Well, of course, you forgot to run regsvr32 on your support DLL before running the application.”
  2. “The DLL was compiled with Project Compatibility set and was registered with a different GUID than my program was looking for. I’m sorry.”
  3. “You’re crazy!”

In many cases C may be true, but B is always the best answer. The setup program will register your component. Since you’ve compiled your application and the support DLL with project compatibility set, your support DLL was given a different GUID. Since you’ve been developing on your machine, you’ll wind up having multiple GUIDs pointing to the same DLL. That won’t be the case on your boss’ machine. Expect extensive coverage of this on the exam. Face it: An application that doesn’t install is useless.

Also expect plenty of debugging questions. To develop an application or component in VB, you’ll need to know the ins and outs of debugging it. VB is a great tool for debugging. To debug an ActiveX DLL or control, you can add a standard .exe project to create a group to do your testing. Create a reference to your DLL or draw the control on a form in your standard .exe project, and you’re ready to begin testing. For an ActiveX .exe you need to run two instances of VB, one with the ActiveX .exe running and the other to create an instance of your out-of-process server (typically a standard .exe project). For the Active Document, you’ll need to use Internet Explorer to run your document.

The Watch Window, Locals Window, Immediate Window, and error objects are on this exam’s hit list! They’re covered well. The proper use of these features will not only help you ace this exam, but also help you test and debug your applications much more efficiently. This same set of topics gets coverage in the VB Distributed Applications exam as well, so you’ll be prepared twice over.

Tip: Always check to see what your compatibility options are—whether your project is set to build on No Compatibility, Project Compatibility, or Binary Compatibility. Watch for those, “Why doesn’t my component register?” or “Why don’t I have the newest changes after the update?” questions. Typically, if you’re not using binary compatibility, you’re missing a required DLL, service pack, or something special to your project. There have been times when I’ve had to sacrifice a small chicken to get something to register (but don’t expect to be tested on that aspect of the job).

The Miscellany

A few subjects surprised me, like coverage of Visual Source Safe and the new Visual Component Manager. Become familiar with some of the new features of VB 6. The Data Environment Designer, Data Report Designer, and ADO Data Control require some study.

Tip: Make sure you’ve tried Visual Source Safe and the Visual Component Manager.

Additional Information
  • You'll find the Preparation Guide for this exam at www.microsoft.
  • Visual Basic Programmer’s Journal has covered some topics you’ll want to know about for your exam preparation. Specifically, I recommend the following articles: “Move To ADO” in the April 1998 issue; “Simplify Data Access” in the November 1998 issue, and “VS 6.0 Benchmarks: New Features Don’t Impact Speed” in the December 1998 issue.

Both More and Less

I was expecting more questions regarding new VB features and a little less about the Package and Deployment Wizard, which is just an updated version of the Setup Wizard that shipped with VB 5.0. (Of course, your version of the exam might have different coverage of these topics.)

I was also hoping to see more on the new Visual Component Manager add-in. I’ve been using it to store frequently-used components, documentation, and samples into the repository for other developers to access. It comes in handy. You can store more than just VB code—HTML, ASP, VC\C++, MFC, ATL, Visual Cobol, or whatever you want. (I’m joking about the Cobol...)

This exam is pretty straightforward. As I’ve said before, you’ll need to know basic user interface elements, data access, the glue that holds these together, debugging, and deployment.

My final advice to you: Create a sample desktop application covering the topics in the Preparation Guide for exam 70-176 from Microsoft, as well as what I’ve covered in this article, and you should be ready to rock!

comments powered by Disqus
Most   Popular