home *** CD-ROM | disk | FTP | other *** search
- SAMPLES.TXT
-
- Samples Notes for Microsoft (R) Visual Basic (TM)
- Professional Edition
-
- Version 2.00
-
- (C) Copyright Microsoft Corporation, 1992
-
- Flip Sample
- -----------
- Program example using the API functions BitBlt and StretchBlt in
- Visual Basic.
-
- BRIEF DESCRIPTION:
- This sample program illustrates the use of BitBlt and StretchBlt
- to produce graphic animation. These functions are used to give
- the illusion of turning tiles with icons on one side and of
- blowing up X's to cover the tiles.
-
- BACKGROUND:
- BitBlt is used to copy icons in certain positions of the form
- itself instead of using individual picture boxes. StretchBlt
- also copies bitmaps from a source to a destination but
- compresses or stretches the original bitmap.
-
- FILES:
- FLIP.FRM..........The main form.
- FLIP.MAK..........The MAKE file for the project.
- FORM.ICO..........The icon for the minimized form.
-
- TO RUN:
- After starting the Visual Basic environment (VB.EXE), you can
- load files in this sample program by choosing Open Project from
- the File menu and select the FLIP.MAK file.
-
- In order to modify or understand this program example, use the
- Windows SDK API Help file installed by the VB 2.0 Professional
- in \VB\WINAPI.
-
- Jigsaw Sample
- -------------
- Program example for using Various Windows GDI Functions in a
- Visual Basic application.
-
- BRIEF DESCRIPTION:
- This sample program illustrates the use of some region
- functions (CreateRectRgn, CombineRgn, SetRectRgn), clipping
- functions (SelectClipRgn), and bitmap (BitBlt) functions that
- are included in the Windows graphics device interface (GDI) to
- simulate a putting together a jigsaw puzzle.
-
- By using these API functions, memory and resource usage is lower
- than if individual picture box controls are used to display and
- move the different pieces of the puzzle around the window.
-
- BACKGROUND:
- Region functions create, alter, and retrieve information about
- regions which can be filled with graphical output. An application
- uses these functions in conjunction with the clipping functions to
- create clipping regions. A clipping region is the portion of a
- window where GDI creates output. Any output sent to that portion
- of the window which is outside the clipping regions will not be
- visible. Bitmap functions display bitmaps. Bitmap functions are
- useful because they let you prepare images in memory and then
- quickly copy them to the display.
-
- FILES:
- ABOUTDLG.FRM.......The dialog box for the "About Box".
- ABOUTDLG.FRX.......The binary portion of the "About Box".
- GLOBAL.BAS.........A global variable declaration.
- JIGSAW.FRM.........The main form.
- JIGSAW.FRX.........The binary portion of the main form.
- JIGSAW.GBL.........Global data types and declarations.
- JIGSAW.MAK.........The MAKE file for the project.
- JSPROCS.BAS........Non-attached Subs and Functions.
- MISC20.ICO.........The icon for the minimized form.
- OPENFILE.FRM.......Dialog box to open files.
-
- TO RUN:
- After starting the Visual Basic environement (VB.EXE), you can
- load the files in this sample program by choosing Open Project
- from the File menu and selecting the JIGSAW.MAK file.
-
- You can also make an executable file and run it as a separate
- program that requires the Visual Basic run-time file VBRUN200.DLL.
-
- In order to modify or understand this program example, you should
- use the Windows SDK API Help file, installed by VB 2.0
- Professional in the \VB\WINAPI directory.
-
- MAPI Sample
- -----------
- Note: To run this sample you need a MAPI-compliant messaging
- system such as the one contained in Microsoft Windows for
- Workgroups.
-
- Program example using the MSMAPI.VBX controls, MapiMessages and
- MapiSession controls.
-
- BRIEF DESCRIPTION:
- This sample program illustrates the use of the MAPI controls by
- sending and receiving electronic mail.
-
- BACKGROUND:
- The MapiSession control establishes a MAPI session and signs off
- from a MAPI session. The MapiMessages control allows you to
- perform a variety of messaging systems functions after a messaging
- session has been established. These functions include accessing,
- downloading, and sending messages, displaying the details and
- address book dialog boxes, accessing data attachments, resolving
- recipient names during addressing, and performing compose, reply,
- reply-all, forward, and deleting actions on messages.
-
- FILES:
- MAILLST.FRM.......Form for displaying the list of mail messages.
- MAILOPTF.FRM......Form for setting options.
- MAILSUP.BAS.......Module of support routines for the example.
- MSGVIEW.FRM.......Form in which a viewed message is displayed.
- NEWMSG.FRM........Form for creating a new message.
- VBMAIL.FRM........The main form.
- VBMAIL.MAK........The MAKE file for the project.
-
- TO RUN:
- After starting the Visual Basic environment (VB.EXE), you can load
- files in this sample program by choosing Open Project from the File
- menu and select the VBMAIL.MAK file.
-
- Multimedia Sample
- -----------------
- This sample program illustrates the use of some of the device types
- supported by the Media Control Interface (MCI). The four device
- types used in this program are:
-
- Device Type Description
- ----------- -----------
- MMMovie Plays Multimedia movie files (*.mmm).
- CDAudio Plays audio discs from the CD-ROM drive.
- Sequencer Plays MIDI sequencer sound files (*.mid).
- WaveAudio Plays digitized waveform sound files (*.wav).
-
- HARDWARE REQUIREMENTS:
- In order to access a CD-ROM drive or a sound card, the hardware,
- along with any supporting device drivers, need to be installed
- and configured for the machine. The following table lists
- the hardware required for the MCI device types used in this
- program:
-
- Device Type Hardware
- ----------- --------
- MMMovie No extra hardware. *See software requirements.
- CDAudio CD-ROM drive.
- Sequencer Sound card (e.g., Sound Blaster Pro)
- WaveAudio Sound card.
-
- SOFTWARE REQUIREMENTS:
- In order to run the MCI application, Microsoft Windows with
- Multimedia Extensions 1.0, or Windows with Multimedia must be
- installed. The Multimedia Extensions include device drivers for
- the different types of MCI devices.
-
- To access a specific MCI device type, the corresponding MCI device
- driver must be installed. The following table list the device
- drivers required for the MCI device types used in this program:
-
- Device Type Device Driver
- ----------- -------------
- MMMovie MCIMMP.DRV *See note below.
- CDAudio MCICDA.DRV
- Sequencer MCISEQ.DRV
- WaveAudio MCIWAVE.DRV
-
- The [mci] section of the SYSTEM.INI file contains a list of the
- installed MCI device types. This is what your file would look
- like if all 4 of the above device types were installed:
-
- [mci]
- CDAudio=mcicda.drv
- WaveAudio=mciwave.drv
- Sequencer=mciseq.drv
- MMMovie=mcimmp.drv
-
- BACKGROUND:
- The MCI control provides a high-level interface for using
- multimedia devices. Using the property settings of a control, you
- can determine the settings and the actions of a device.
-
- The MCI control is also smart enough to know what action are
- relevant for the current state of a device. For example, if you
- click on a "Pause" button while playing a movie, the "Play"
- button is automatically re-enabled.
-
- NOTE:
- If you are unable to run an animation movie (*.mmm file), make
- sure the MCIMMP.DRV and MMP.DLL files are installed on your
- machine. To install the animation driver from Windows 3.1, run
- the "Drivers" applet from the Control Panel, insert Disk 1 of the
- Professional Edition. Select "Unlisted Driver", and accept "A:\"
- as the directory. You will then be ready to use the animation
- features of the MCI control.
-
- FILES:
- ABOUTBOX.FRM.......The dialog box for the "About Box".
- ANIMATE.FRM........Form for playing Multimedia Movie files.
- CD.FRM.............The form for playing compact disc audio.
- GLOBAL.BAS.........Global data types and declarations.
- MCITEST.BAS........Global Subs and Functions.
- MCITEST.FRM........The main form.
- MCITEST.MAK........The MAKE file for the project.
- MCITEST.MID........Sample MIDI sequencer file.
- MCITEST.MMM........Sample Multimedia Movie file.
- MCITEST.WAV........Sample waveform file.
- OPENDLG.FRM........Form for holding the Common Dialog control.
- WAVE.FRM...........Form for playing waveform and MIDI files.
-
- TO RUN:
- In the Visual Basic environment (VB.EXE), you can load the files
- in this sample program by choosing Open Project from the File
- menu, and selecting the MCITEST.MAK file.
-
- Two additional files appear in the Project Window:
-
- MCI.VBX............MCI control.
- CMDIALOG.VBX.......Common Dialog control.
-
- PEN Sample
- ----------
- Note: To run this sample you must have Windows for Pen Computing,
- or install the PENWIN.DLL file. See below.
-
- BRIEF DESCRIPTION of PEN SAMPLE PROGRAM:
- This sample program illustrates many uses of the Pen controls:
- * the new On-Screen Keyboard control
- * inking and displaying bitmaps on the new InkOnBitmap control
- * handwriting recognition in both delayed and non-delayed mode
- * recognition of gestures
- * transfer of ink data between controls
- * manipulation of the Recognition Context data structure
- and more.
-
- The file PENAPI.TXT contains function and constant declarations
- for the entire set of Windows for Pen Computing API.
-
- FILES:
- DELAY.FRM.........Form for demonstrating Delayed Recognition.
- DELAY.FRX.........The binary for DELAY.FRM.
- EDITSUBF.FRM......Support Form for Gesture demonstration.
- GESTFRM.FRM.......Form for demonstrating Custom Gestures.
- INKFRM.FRM........Form for showing transfer of Ink data.
- IOBFRM.FRM........Form demonstrating the Ink On Bitmap control.
- IOBFRM.FRX........The binary for IOBFRM.FRM.
- KEYBRD.FRM........Form for the On-Screen Keyboard Button demo.
- KEYBRD.FRX........The binary for KEYBRD.FRM.
- PENAPI.TXT........Pen function declarations and constants.
- PENMAIN.FRM.......Main form.
- PENMAIN.FRX.......The binary for MAIN.FRM.
- PENSMPL.MAK.......The MAKE file for the project.
- RCFRM.FRM.........Form demonstrating the Recognition Context.
- GRAFPAPR.BMP......Bitmap for creating graph paper effect.
- RULEPAPR.BMP......Bitmap for creating ruled paper effect.
- SKBFACE.BMP.......Bitmap of default keyboard on SKB Button.
- TRANSFRM.FRM......Form for demonstrating transfer of ink data.
-
- TO RUN:
- After starting the Visual Basic environment (VB.EXE), you can load
- files in this sample program by choosing Open Project from the File
- menu and select the PENSMPL.MAK file.
-
- Installing PENWIN.DLL:
- This procedure will result in a system that will let you run
- applications that contain Visual Basic BEdit, HEdit, InkOnBitmap,
- and SKB Button controls and call the Windows for Pen Computing APIs.
- You will not be able to perform handwriting recognition or draw ink
- on the screen. Microsoft Windows 3.1 is required.
-
- SYSTEM.INI Changes
- The following items must be added or changed in your SYSTEM.INI
- file so that the pen extensions will work. NOTE: Back up your old
- SYSTEM.INI file before proceeding.
-
- 1. In the "[boot]" section:
- Add "penwindows" to the list of drivers after "drivers=".
- For example:
- drivers=mmsystem.dll penwindows
-
- 2. In the "[drivers]" section:
- Add a new item "penwindows" and set it equal to the path to
- PENWIN.DLL.
- For example:
- penwindows=C:\WINDOWS\PENWIN.DLL
-
- 3. Restart Windows so the changes can take effect.
-
- When Windows is restarted PENWIN.DLL will be loaded as an
- installed driver and you will be able to run applications
- containing Visual Basic BEdit, HEdit, InkOnBitmap, and SKB
- Button controls and call the Windows for Pen Computing APIs.
-
- PicClip Sample
- --------------
- Program example using the PICCLIP.VBX control.
-
- BRIEF DESCRIPTION:
- This sample program illustrates one of the many possible uses of
- the Picture Clipping control.
-
- BACKGROUND:
- This sample application uses the PicClip control to spin a top.
-
- FILES:
- INFOFORM.FRM......The information form.
- INFOFORM.FRX......The binary data for the information form.
- REDTOP.FRM........The main form.
- REDTOP.FRX........The binary data for the main form.
- REDTOP.MAK........The MAKE file for the project.
-
- TO RUN:
- After starting the Visual Basic environment (VB.EXE), you can
- load files in this sample program by choosing Open Project from
- the File menu and select the REDTOP.MAK file.
-
- ODBC Sample
- -----------
- Note: to run this sample you must first install ODBC using the
- ODBC setup program provided with Visual Basic Professional.
-
- Program example using the ODBC object layer.
-
- BRIEF DESCRIPTION:
- This sample program illustrates various programming techniques
- used to access data through the VT (Virtual Table) layer built into
- Visual Basic Professional. It behaves like a general purpose
- database utility capable of the following functions:
- 1. Table Creation
- 2. Table Modification (adding fields, adding and deleting
- indexes)
- 3. Data Browsing one record at a time (updatable on single
- table dynasets)
- 4. Data Browsing via the Grid control (non-updatable)
- 5. Data Export to Tab Delimited text file
- 6. Direct SQL Statement execution for any SQL supported
- functions such as Insert, Update, Delete, Drop, Create,
- Dump, etc.
- 7. AdHoc Query tool that helps users unfamiliar with SQL
- create complex queries with where clauses, joins, order
- by and group by expressions while limiting output to
- selected columns
- 8. Transaction Processing
- 9. Copying table structures to same or different server
-
- The code contains comments to help explain the use of the various
- methods in the data access layer. Code and forms may be copied
- from this application to other applications with minimal
- modification.
-
- BACKGROUND:
- ODBC (Open DataBase Connectivity) is a standard adopted by
- multiple vendors designed to enable users to connect to any data
- source with a single application. This is achieved through a
- layered approach including:
- 1. Programming Layer-embedded functions in the development
- tool which in this case is Visual Basic Professional.
- 2. Driver Manager-the basic ODBC library that routes calls
- to the appropriate driver.
- 3. Data Driver - the library of functions that acts upon a
- specific database backend such as SQL Server, Xbase,
- Excel, etc. (note that SQL Server is the first of many
- drivers to become available for ODBC)
- These layers work together to enable data access from any source
- for which an ODBC driver exists. The sample application will work,
- without modification, on any new level one ODBC driver that becomes
- available. With multiple drivers, connections may be made to
- different data sources from the same application at the same time
- enabling seamless data access from disparate data sources.
-
- FILES:
- ABOUTBOX.FRM......Standard "About box" for the application.
- ABOUTBOX.FRX......Icon for the "About Box".
- ADDFIELD.FRM......Form to add fields to Tables.
- CPYSTRU.FRM.......Form to copy Table structures.
- DATABOX.FRM.......General purpose list form.
- DYNAGRID.FRM......Form used to display data in a Grid control.
- DYNAGRID.FRX......Icon for DYNAGRID.FRM.
- DYNASET.FRM.......Form to display data in single record mode.
- DYNASET.FRX.......Icon for DYNASET.FRM
- FIND.FRM..........Form used to find records in a Dynaset.
- INDEXADD.FRM......Form used to add indexes to Tables.
- JOIN.FRM..........Form used to add Joins to the Query Builder.
- OPENDB.FRM........Form used to open a database.
- QUERY.FRM.........Form used to build Queries.
- QUERY.FRX.........Icon for QUERY.FRM.
- REPLACE.FRM.......Form to perform global replaces on a Table.
- REPLACE.FRX.......Icon for REPLACE.FRM.
- SQL.FRM...........Form to enter and execute SQL statements.
- SQL.FRX...........Icon for SQL.FRM.
- TABLES.FRM........Form used to display table lists.
- TABLES.FRX........Icon for TABLES.FRM.
- TBLSTRU.FRM.......Form to display and modify table structures.
- VDMDI.FRM.........Main MDI form for the application.
- VDMDI.FRX.........Icon for VDMDI.FRM.
- VISDATA.BAS.......Support functions for the application.
- VISDATA.ICO.......Icon for the applicaiton.
- VISDATA.MAK.......Make file for applicaiton.
- ZOOM.FRM..........Form to zoom in on character data in the
- dynaset forms.
-
- TO RUN:
- After starting the Visual Basic environment (VB.EXE), you can
- load files in this sample program by choosing Open Project from
- the File menu and select the VISDATA.MAK file in the
- SAMPLES\VBODBC directory.
-
- The first dialog you will see is the Open DataBase form. Since
- you probably have no servers entered, you will need to enter a
- name for an existing SQL server on your network. If you already
- know the user ID and password, you can add them as well. The
- Database name is optional. Once you have entered this data,
- select 'Okay' and you should be able to log on to the server. You
- may get some more dialogs in the process. Answer any questions
- you can and ask the SQL administrator for help if you run into
- problems or don't know some of the parameters.
-
- Once connected to a server, a simple double click on a table name
- will open the table in the selected mode (Single Record or Table
- View). Use the Query Builder to create dynasets with selected
- data from one or more tables at a time.
-
- *Note that only Full Single table dynasets with Unique indexes
- are updatable. These are created using the Open button or double
- clicking a table name in Single Record mode. If this still
- doesn't allow updating, the table probably doesn't have a unique
- index on it.
-
- Communications Sample
- ---------------------
- Program example using MSCOMM.VBX in a terminal emulation program.
-
- BRIEF DESCRIPTION:
- This sample program illustrates how to use the communications
- control with a serial port.
-
- BACKGROUND:
- MSCOMM.VBX allows you to open a serial port, change its settings,
- send and receive data through the port, and monitor and set many
- of the different data lines. It's dual-method access allows for
- both polling and event driven communications.
-
- FILES:
- CANSEND.FRM.......Dialog box used during file transfer.
- TERMSET.FRM.......Form used to change the serial port settings.
- TERMSET.FRX.......Binary data for TERMSET.FRM.
- VBTERM.FRM........The main form.
- VBTERM.FRX........Binary data for VBTERM.FRM.
- VBTERM.GLO........Global declarations.
- VBTERM.MAK........The MAKE file for the project.
-
- TO RUN:
- After starting the Visual Basic environment (VB.EXE), you can load
- files in this sample program by choosing Open Project from the File
- menu and select the VBTERM.MAK file.
-