home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l406 / 4.ddi / SAMPLES.TX_ / SAMPLES.bin
Encoding:
Text File  |  1992-10-21  |  18.9 KB  |  461 lines

  1.                               SAMPLES.TXT
  2.  
  3.            Samples Notes for Microsoft (R) Visual Basic (TM)
  4.                           Professional Edition
  5.  
  6.                               Version 2.00
  7.  
  8.                   (C) Copyright Microsoft Corporation, 1992
  9.  
  10. Flip Sample
  11. -----------
  12. Program example using the API functions BitBlt and StretchBlt in
  13. Visual Basic.
  14.  
  15. BRIEF DESCRIPTION:
  16. This sample program illustrates the use of BitBlt and StretchBlt
  17. to produce graphic animation.  These functions are used to give
  18. the illusion of turning tiles with icons on one side and of 
  19. blowing up X's to cover the tiles.
  20.  
  21. BACKGROUND:
  22. BitBlt is used to copy icons in certain positions of the form
  23. itself instead of using individual picture boxes.  StretchBlt
  24. also copies bitmaps from a source to a destination but
  25. compresses or stretches the original bitmap.
  26.  
  27. FILES:
  28.    FLIP.FRM..........The main form.
  29.    FLIP.MAK..........The MAKE file for the project.
  30.    FORM.ICO..........The icon for the minimized form.
  31.  
  32. TO RUN:
  33. After starting the Visual Basic environment (VB.EXE), you can
  34. load files in this sample program by choosing Open Project from
  35. the File menu and select the FLIP.MAK file.
  36.  
  37. In order to modify or understand this program example, use the
  38. Windows SDK API Help file installed by the VB 2.0 Professional 
  39. in \VB\WINAPI.
  40.  
  41. Jigsaw Sample
  42. -------------
  43. Program example for using Various Windows GDI Functions in a
  44. Visual Basic application.
  45.  
  46. BRIEF DESCRIPTION:
  47. This sample program illustrates the use of some region
  48. functions (CreateRectRgn, CombineRgn, SetRectRgn), clipping 
  49. functions (SelectClipRgn), and bitmap (BitBlt) functions that
  50. are included in the Windows graphics device interface (GDI) to
  51. simulate a putting together a jigsaw puzzle.
  52.  
  53. By using these API functions, memory and resource usage is lower
  54. than if individual picture box controls are used to display and
  55. move the different pieces of the puzzle around the window.
  56.  
  57. BACKGROUND:
  58. Region functions create, alter, and retrieve information about
  59. regions which can be filled with graphical output.  An application
  60. uses these functions in conjunction with the clipping functions to
  61. create clipping regions.  A clipping region is the portion of a
  62. window where GDI creates output.  Any output sent to that portion 
  63. of the window which is outside the clipping regions will not be 
  64. visible.  Bitmap functions display bitmaps.  Bitmap functions are
  65. useful because they let you prepare images in memory and then 
  66. quickly copy them to the display.
  67.  
  68. FILES:
  69.    ABOUTDLG.FRM.......The dialog box for the "About Box".
  70.    ABOUTDLG.FRX.......The binary portion of the "About Box".
  71.    GLOBAL.BAS.........A global variable declaration.
  72.    JIGSAW.FRM.........The main form.
  73.    JIGSAW.FRX.........The binary portion of the main form.
  74.    JIGSAW.GBL.........Global data types and declarations.
  75.    JIGSAW.MAK.........The MAKE file for the project.
  76.    JSPROCS.BAS........Non-attached Subs and Functions.
  77.    MISC20.ICO.........The icon for the minimized form.
  78.    OPENFILE.FRM.......Dialog box to open files.
  79.  
  80. TO RUN:
  81. After starting the Visual Basic environement (VB.EXE), you can 
  82. load the files in this sample program by choosing Open Project 
  83. from the File menu and selecting the JIGSAW.MAK file.
  84.  
  85. You can also make an executable file and run it as a separate 
  86. program that requires the Visual Basic run-time file VBRUN200.DLL.
  87.  
  88. In order to modify or understand this program example, you should
  89. use the Windows SDK API Help file, installed by VB 2.0
  90. Professional in the \VB\WINAPI directory.
  91.  
  92. MAPI Sample
  93. -----------
  94. Note:  To run this sample you need a MAPI-compliant messaging
  95.        system such as the one contained in Microsoft Windows for
  96.        Workgroups.
  97.  
  98. Program example using the MSMAPI.VBX controls, MapiMessages and 
  99. MapiSession controls.
  100.  
  101. BRIEF DESCRIPTION:
  102. This sample program illustrates the use of the MAPI controls by 
  103. sending and receiving electronic mail.
  104.  
  105. BACKGROUND:
  106. The MapiSession control establishes a MAPI session and signs off
  107. from a MAPI session.  The MapiMessages control allows you to 
  108. perform a variety of messaging systems functions after a messaging 
  109. session has been established.  These functions include accessing, 
  110. downloading, and sending messages, displaying the details and 
  111. address book dialog boxes, accessing data attachments, resolving 
  112. recipient names during addressing, and performing compose, reply, 
  113. reply-all, forward, and deleting actions on messages.
  114.  
  115. FILES:
  116.    MAILLST.FRM.......Form for displaying the list of mail messages.
  117.    MAILOPTF.FRM......Form for setting options.
  118.    MAILSUP.BAS.......Module of support routines for the example.
  119.    MSGVIEW.FRM.......Form in which a viewed message is displayed.
  120.    NEWMSG.FRM........Form for creating a new message.
  121.    VBMAIL.FRM........The main form.
  122.    VBMAIL.MAK........The MAKE file for the project.
  123.  
  124. TO RUN:
  125. After starting the Visual Basic environment (VB.EXE), you can load
  126. files in this sample program by choosing Open Project from the File
  127. menu and select the VBMAIL.MAK file.
  128.  
  129. Multimedia Sample
  130. -----------------
  131. This sample program illustrates the use of some of the device types
  132. supported by the Media Control Interface (MCI).  The four device 
  133. types used in this program are:
  134.  
  135.    Device Type     Description
  136.    -----------     -----------
  137.    MMMovie         Plays Multimedia movie files (*.mmm).
  138.    CDAudio         Plays audio discs from the CD-ROM drive.
  139.    Sequencer       Plays MIDI sequencer sound files (*.mid).
  140.    WaveAudio       Plays digitized waveform sound files (*.wav).
  141.  
  142. HARDWARE REQUIREMENTS:
  143. In order to access a CD-ROM drive or a sound card, the hardware,
  144. along with any supporting device drivers, need to be installed
  145. and configured for the machine.  The following table lists
  146. the hardware required for the MCI device types used in this
  147. program:
  148.  
  149.    Device Type     Hardware
  150.    -----------     --------
  151.    MMMovie         No extra hardware.  *See software requirements.
  152.    CDAudio         CD-ROM drive.
  153.    Sequencer       Sound card (e.g., Sound Blaster Pro)
  154.    WaveAudio       Sound card.
  155.  
  156. SOFTWARE REQUIREMENTS:
  157. In order to run the MCI application, Microsoft Windows with
  158. Multimedia Extensions 1.0, or Windows with Multimedia must be 
  159. installed.  The Multimedia Extensions include device drivers for
  160. the different types of MCI devices.
  161.  
  162. To access a specific MCI device type, the corresponding MCI device
  163. driver must be installed.  The following table list the device 
  164. drivers required for the MCI device types used in this program:
  165.  
  166.    Device Type     Device Driver
  167.    -----------     -------------
  168.    MMMovie         MCIMMP.DRV    *See note below.
  169.    CDAudio         MCICDA.DRV
  170.    Sequencer       MCISEQ.DRV
  171.    WaveAudio       MCIWAVE.DRV
  172.  
  173. The [mci] section of the SYSTEM.INI file contains a list of the
  174. installed MCI device types.  This is what your file would look
  175. like if all 4 of the above device types were installed:
  176.  
  177. [mci]
  178. CDAudio=mcicda.drv
  179. WaveAudio=mciwave.drv
  180. Sequencer=mciseq.drv
  181. MMMovie=mcimmp.drv
  182.  
  183. BACKGROUND:
  184. The MCI control provides a high-level interface for using 
  185. multimedia devices. Using the property settings of a control, you
  186. can determine the settings and the actions of a device.
  187.  
  188. The MCI control is also smart enough to know what action are 
  189. relevant for the current state of a device.  For example, if you 
  190. click on a "Pause" button while playing a movie, the "Play" 
  191. button is automatically re-enabled.
  192.  
  193. NOTE:
  194. If you are unable to run an animation movie (*.mmm file), make 
  195. sure the MCIMMP.DRV and MMP.DLL files are installed on your 
  196. machine.  To install the animation driver from Windows 3.1, run 
  197. the "Drivers" applet from the Control Panel, insert Disk 1 of the
  198. Professional Edition.  Select "Unlisted Driver", and accept "A:\"
  199. as the directory.  You will then be ready to use the animation 
  200. features of the MCI control.
  201.  
  202. FILES:
  203.    ABOUTBOX.FRM.......The dialog box for the "About Box".
  204.    ANIMATE.FRM........Form for playing Multimedia Movie files.
  205.    CD.FRM.............The form for playing compact disc audio.
  206.    GLOBAL.BAS.........Global data types and declarations.
  207.    MCITEST.BAS........Global Subs and Functions.
  208.    MCITEST.FRM........The main form.
  209.    MCITEST.MAK........The MAKE file for the project.
  210.    MCITEST.MID........Sample MIDI sequencer file.
  211.    MCITEST.MMM........Sample Multimedia Movie file.
  212.    MCITEST.WAV........Sample waveform file.
  213.    OPENDLG.FRM........Form for holding the Common Dialog control.
  214.    WAVE.FRM...........Form for playing waveform and MIDI files.
  215.  
  216. TO RUN:
  217. In the Visual Basic environment (VB.EXE), you can load the files
  218. in this sample program by choosing Open Project from the File 
  219. menu, and selecting the MCITEST.MAK file.
  220.  
  221. Two additional files appear in the Project Window:
  222.  
  223.    MCI.VBX............MCI control.
  224.    CMDIALOG.VBX.......Common Dialog control.
  225.  
  226. PEN Sample
  227. ----------
  228. Note:  To run this sample you must have Windows for Pen Computing, 
  229.        or install the PENWIN.DLL file.  See below.
  230.  
  231. BRIEF DESCRIPTION of PEN SAMPLE PROGRAM:
  232. This sample program illustrates many uses of the Pen controls:
  233.   * the new On-Screen Keyboard control
  234.   * inking and displaying bitmaps on the new InkOnBitmap control
  235.   * handwriting recognition in both delayed and non-delayed mode
  236.   * recognition of gestures
  237.   * transfer of ink data between controls
  238.   * manipulation of the Recognition Context data structure
  239. and more.
  240.  
  241. The file PENAPI.TXT contains function and constant declarations
  242. for the entire set of Windows for Pen Computing API.
  243.  
  244. FILES:
  245.    DELAY.FRM.........Form for demonstrating Delayed Recognition.
  246.    DELAY.FRX.........The binary for DELAY.FRM.
  247.    EDITSUBF.FRM......Support Form for Gesture demonstration.
  248.    GESTFRM.FRM.......Form for demonstrating Custom Gestures.
  249.    INKFRM.FRM........Form for showing transfer of Ink data.
  250.    IOBFRM.FRM........Form demonstrating the Ink On Bitmap control.
  251.    IOBFRM.FRX........The binary for IOBFRM.FRM.
  252.    KEYBRD.FRM........Form for the On-Screen Keyboard Button demo.
  253.    KEYBRD.FRX........The binary for KEYBRD.FRM.
  254.    PENAPI.TXT........Pen function declarations and constants.
  255.    PENMAIN.FRM.......Main form.
  256.    PENMAIN.FRX.......The binary for MAIN.FRM.
  257.    PENSMPL.MAK.......The MAKE file for the project.
  258.    RCFRM.FRM.........Form demonstrating the Recognition Context.
  259.    GRAFPAPR.BMP......Bitmap for creating graph paper effect.
  260.    RULEPAPR.BMP......Bitmap for creating ruled paper effect.
  261.    SKBFACE.BMP.......Bitmap of default keyboard on SKB Button.
  262.    TRANSFRM.FRM......Form for demonstrating transfer of ink data.
  263.  
  264. TO RUN:
  265. After starting the Visual Basic environment (VB.EXE), you can load
  266. files in this sample program by choosing Open Project from the File
  267. menu and select the PENSMPL.MAK file.
  268.  
  269. Installing PENWIN.DLL:
  270. This procedure will result in a system that will let you run
  271. applications that contain Visual Basic BEdit, HEdit, InkOnBitmap,
  272. and SKB Button controls and call the Windows for Pen Computing APIs.
  273. You will not be able to perform handwriting recognition or draw ink
  274. on the screen. Microsoft Windows 3.1 is required.
  275.  
  276. SYSTEM.INI Changes
  277. The following items must be added or changed in your SYSTEM.INI
  278. file so that the pen extensions will work.  NOTE: Back up your old
  279. SYSTEM.INI file before proceeding.
  280.  
  281. 1.  In the "[boot]" section:
  282.       Add "penwindows" to the list of drivers after "drivers=".
  283.       For example:
  284.         drivers=mmsystem.dll penwindows
  285.  
  286. 2.  In the "[drivers]" section:
  287.       Add a new item "penwindows" and set it equal to the path to 
  288.       PENWIN.DLL.
  289.       For example:
  290.         penwindows=C:\WINDOWS\PENWIN.DLL
  291.  
  292. 3.  Restart Windows so the changes can take effect.
  293.  
  294. When Windows is restarted PENWIN.DLL will be loaded as an
  295. installed driver and you will be able to run applications
  296. containing Visual Basic BEdit, HEdit, InkOnBitmap, and SKB
  297. Button controls and call the Windows for Pen Computing APIs.
  298.  
  299. PicClip Sample
  300. --------------
  301. Program example using the PICCLIP.VBX control.
  302.  
  303. BRIEF DESCRIPTION:
  304. This sample program illustrates one of the many possible uses of
  305. the Picture Clipping control.
  306.  
  307. BACKGROUND:
  308. This sample application uses the PicClip control to spin a top.
  309.  
  310. FILES:
  311.    INFOFORM.FRM......The information form.
  312.    INFOFORM.FRX......The binary data for the information form.
  313.    REDTOP.FRM........The main form.
  314.    REDTOP.FRX........The binary data for the main form.
  315.    REDTOP.MAK........The MAKE file for the project.
  316.  
  317. TO RUN:
  318. After starting the Visual Basic environment (VB.EXE), you can 
  319. load files in this sample program by choosing Open Project from
  320. the File menu and select the REDTOP.MAK file.
  321.  
  322. ODBC Sample
  323. -----------
  324. Note:  to run this sample you must first install ODBC using the
  325.        ODBC setup program provided with Visual Basic Professional.
  326.  
  327. Program example using the ODBC object layer.
  328.  
  329. BRIEF DESCRIPTION:
  330. This sample program illustrates various programming techniques 
  331. used to access data through the VT (Virtual Table) layer built into
  332. Visual Basic Professional.  It behaves like a general purpose
  333. database utility capable of the following functions:
  334.        1. Table Creation
  335.        2. Table Modification (adding fields, adding and deleting 
  336.           indexes)
  337.        3. Data Browsing one record at a time (updatable on single 
  338.           table dynasets)
  339.        4. Data Browsing via the Grid control (non-updatable)
  340.        5. Data Export to Tab Delimited text file
  341.        6. Direct SQL Statement execution for any SQL supported
  342.           functions such  as Insert, Update, Delete, Drop, Create,
  343.           Dump, etc.
  344.        7. AdHoc Query tool that helps users unfamiliar with SQL 
  345.           create complex queries with where clauses, joins, order 
  346.           by and group by expressions while limiting output to 
  347.           selected columns
  348.        8. Transaction Processing
  349.        9. Copying table structures to same or different server
  350.  
  351. The code contains comments to help explain the use of the various 
  352. methods in the data access layer.  Code and forms may be copied 
  353. from this application to other applications with minimal 
  354. modification.
  355.  
  356. BACKGROUND:
  357. ODBC  (Open DataBase Connectivity) is a standard adopted by 
  358. multiple vendors designed to enable users to connect to any data
  359. source with a single application.  This is achieved through a 
  360. layered approach including:
  361.        1. Programming Layer-embedded functions in the development
  362.           tool which in this case is Visual Basic Professional.
  363.        2. Driver Manager-the basic ODBC library that routes calls
  364.           to the appropriate driver.
  365.        3. Data Driver - the library of functions that acts upon a 
  366.           specific database backend such as SQL Server, Xbase, 
  367.           Excel, etc. (note that SQL Server is the first of many 
  368.           drivers to become available for ODBC)
  369. These layers work together to enable data access from any source 
  370. for which an ODBC driver exists.  The sample application will work,
  371. without modification, on any new level one ODBC driver that becomes
  372. available.  With multiple drivers, connections may be made to 
  373. different data sources from the same application at the same time
  374. enabling seamless data access from disparate data sources.
  375.  
  376. FILES:
  377.    ABOUTBOX.FRM......Standard "About box" for the application.
  378.    ABOUTBOX.FRX......Icon for the "About Box".
  379.    ADDFIELD.FRM......Form to add fields to Tables.
  380.    CPYSTRU.FRM.......Form to copy Table structures.
  381.    DATABOX.FRM.......General purpose list form.
  382.    DYNAGRID.FRM......Form used to display data in a Grid control.
  383.    DYNAGRID.FRX......Icon for DYNAGRID.FRM.
  384.    DYNASET.FRM.......Form to display data in single record mode.
  385.    DYNASET.FRX.......Icon for DYNASET.FRM
  386.    FIND.FRM..........Form used to find records in a Dynaset.
  387.    INDEXADD.FRM......Form used to add indexes to Tables.
  388.    JOIN.FRM..........Form used to add Joins to the Query Builder.
  389.    OPENDB.FRM........Form used to open a database.
  390.    QUERY.FRM.........Form used to build Queries.
  391.    QUERY.FRX.........Icon for QUERY.FRM.
  392.    REPLACE.FRM.......Form to perform global replaces on a Table.
  393.    REPLACE.FRX.......Icon for REPLACE.FRM.
  394.    SQL.FRM...........Form to enter and execute SQL statements.
  395.    SQL.FRX...........Icon for SQL.FRM.
  396.    TABLES.FRM........Form used to display table lists.
  397.    TABLES.FRX........Icon for TABLES.FRM.
  398.    TBLSTRU.FRM.......Form to display and modify table structures.
  399.    VDMDI.FRM.........Main MDI form for the application.
  400.    VDMDI.FRX.........Icon for VDMDI.FRM.
  401.    VISDATA.BAS.......Support functions for the application.
  402.    VISDATA.ICO.......Icon for the applicaiton.
  403.    VISDATA.MAK.......Make file for applicaiton.
  404.    ZOOM.FRM..........Form to zoom in on character data in the
  405.                      dynaset forms.
  406.  
  407. TO RUN:
  408. After starting the Visual Basic environment (VB.EXE), you can
  409. load files in this sample program by choosing Open Project from 
  410. the File menu and select the VISDATA.MAK file in the 
  411. SAMPLES\VBODBC directory.
  412.  
  413. The first dialog you will see is the Open DataBase form.  Since
  414. you probably have no servers entered, you will need to enter a 
  415. name for an existing SQL server on your network.  If you already
  416. know the user ID and password, you can add them as well.  The 
  417. Database name is optional.  Once you have entered this data, 
  418. select 'Okay' and you should be able to log on to the server. You
  419. may get some more dialogs in the process.  Answer any questions 
  420. you can and ask the SQL administrator for help if you run into 
  421. problems or don't know some of the parameters.
  422.  
  423. Once connected to a server, a simple double click on a table name
  424. will open the table in the selected mode (Single Record or Table 
  425. View).  Use the Query Builder to create dynasets with selected 
  426. data from one or more tables at a time.
  427.  
  428. *Note that only Full Single table dynasets with Unique indexes 
  429. are updatable.  These are created using the Open button or double
  430. clicking a table name in Single Record mode.  If this still 
  431. doesn't allow updating, the table probably doesn't have a unique 
  432. index on it.
  433.  
  434. Communications Sample
  435. ---------------------
  436. Program example using MSCOMM.VBX in a terminal emulation program.
  437.  
  438. BRIEF DESCRIPTION:
  439. This sample program illustrates how to use the communications
  440. control with a serial port.
  441.  
  442. BACKGROUND:
  443. MSCOMM.VBX allows you to open a serial port, change its settings, 
  444. send and receive data through the port, and monitor and set many 
  445. of the different data lines.  It's dual-method access allows for 
  446. both polling and event driven communications.
  447.  
  448. FILES:
  449.    CANSEND.FRM.......Dialog box used during file transfer.
  450.    TERMSET.FRM.......Form used to change the serial port settings.
  451.    TERMSET.FRX.......Binary data for TERMSET.FRM.
  452.    VBTERM.FRM........The main form.
  453.    VBTERM.FRX........Binary data for VBTERM.FRM.
  454.    VBTERM.GLO........Global declarations.
  455.    VBTERM.MAK........The MAKE file for the project.
  456.  
  457. TO RUN:
  458. After starting the Visual Basic environment (VB.EXE), you can load
  459. files in this sample program by choosing Open Project from the File
  460. menu and select the VBTERM.MAK file.
  461.