2049CH08 - Bitter, Rick et al "ActiveX...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Bitter, Rick et al "ActiveX Examples" LabVIEW Advanced Programming Techinques Boca Raton: CRC Press LLC,2001 8 ©2001 CRC Press LLC ActiveX Examples This chapter is a follow-up to Chapter 7 on ActiveX. In Chapter 7, you were introduced to OLE, COM, DDE, ActiveX, and their significance to programming. The related terminology was defined along with a description on how these technologies work. The chapter concluded by showing LabVIEW’s ActiveX interface and the related tools available to the programmer for developing applications. In this chapter we will provide several examples that utilize ActiveX controls and automation. The material here serves two purposes. The first is to give you enough exposure to ActiveX so that you will be comfortable using it in your own applications effectively. By employing the services offered by ActiveX objects, code reuse is significantly enhanced. This is a key advantage that was gained by the introduction of COM. The second intent is to give you some practical examples that you can modify and utilize in your applications. Even if the examples are not directly applicable to your situation, they will give you a new way of thinking to apply ActiveX that you may not have considered before. 8.1 COMMON DIALOG CONTROL The Common Dialog control is familiar to almost every Visual Basic programmer. Microsoft elected to provide a uniform interface to the dialog boxes for printing, opening, saving, and color selection. These were wrapped into a single dialog box and became known as the Common Dialog control. Every application you use, you can see the familiar Print, Open, and Save Boxes is using this control. Being a user interface element, it was desirable for Microsoft to have standard mechanisms for users to perform common tasks. This allows the Windows operating system to provide a consistent look and feel to end users regardless of which company was developing software to use on the operating system. We can use the Common Dialog control to keep the Windows look and feel consistent for our end users. This control is useful if you are using file saving and not using the high-level interfaces provided by LabVIEW. If you are using the high- level interfaces, you do not need to use this control; LabVIEW is using it for you! This example uses the Microsoft Common Dialog Control Version 6.0. The Common Dialog Control is relatively simple to use and will serve as the introductory example. It is useful for prompting the operator to select a specific file for opening and saving purposes, while also allowing them to navigate through the Windows directories. ©2001 CRC Press LLC Figure 8.1 displays the code diagram of Common Dialog.vi. The Common Dialog control was placed in the front panel ActiveX container, and is represented by the refnum on the diagram. The objective of this VI is to display the dialog box and instruct the user of the application to select a file. The name of the file that the user selects is then retrieved from the control and used elsewhere. In this example,user selects is then retrieved from the control and used elsewhere....
View Full Document

Page1 / 52

2049CH08 - Bitter, Rick et al "ActiveX...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online