With Visual Basic, it's easy to streamline and extend the capabilities of your applications. This chapter presents a few advanced programming techniques that will help you make your Visual Basic applications more efficient and robust.
First I show you how to create a dynamic link library (DLL), which is a great way to speed up the execution of critical sections of your Visual Basic applications. Prior to Visual Basic 4, the only way you could create a DLL was by using another programming language, such as C. Although C is still a good choice, now you can also use Visual Basic itself to create high-speed, compiled DLL modules using in-process ActiveX technology. I'll show you examples of both DLL creation techniques.
Although not new to Visual Basic, remote automation makes its debut in this chapter. Remote automation lets you access objects running on servers from your local machine. The Visual Basic Enterprise Edition can create remote applications that run on Windows NT and Windows 95 servers. I'll walk you through creating, debugging, installing, and using a simple remote application. Plus I'll give you some troubleshooting tips for working with remote automation.
Next I'll introduce another feature of Visual Basic: the ability to create add-ins for Visual Basic's integrated development environment (IDE). In this section, you will learn how to create a simple add-in using Visual Basic itself.
I'll also talk about how you can make your application interact with macros written in VBScript. These macros can be run outside your application using the Windows Scripting Host (WScript.EXE) or within your application using the Microsoft Script control (MSScript.OCX). Macros let users automate repetitive tasks and create testing suites for applications that provide ActiveX objects.
Finally I'll show you how you can define and use object properties that have user-defined types (UDTs).