home *** CD-ROM | disk | FTP | other *** search
-
- README.TXT
-
- Release Notes for Microsoft (R) Visual Basic Control Development Kit
-
- Version 1.00
-
- (C) Copyright Microsoft Corporation, 1991
-
- This document contains release notes for version 1.00 of the Microsoft (R)
- Control Development Kit for Microsoft (R) Visual Basic for Microsoft (R)
- Windows version 3.0 and later. The information in this document is more
- current than that in the manual.
-
- You have a royalty-free right to use, modify, reproduce and distribute
- the Sample Custom Control Files (and/or any modified version) in any way
- you find useful, provided that you agree that Microsoft has no warranty,
- obligation or liability for any Custom Control File.
-
-
- ===============================================================================
- Contents
- ===============================================================================
-
- Part Description
- ---- -----------
-
- 1 Notes for "Microsoft Visual Basic Control Development Guide"
-
- 2 Additional API Calls
-
- 3 Miscellaneous Notes and Tips
-
-
- ===============================================================================
- Part 1: Notes for "Microsoft Visual Basic Control Development Guide"
- ===============================================================================
-
- Section\Note
- ------------
-
- Installing the CDK Files
- ------------------------
- The PIX source code directory should also be mentioned
-
- Creating a Toolbox Icon
- -----------------------
- The documentation should state that only four bitmap files are
- required, not six. The down-position bitmaps are not used for
- EGA or monochrome displays; instead, Visual Basic just inverts
- the up-position icon when it is selected. For this reason, the
- sample source code directories provided include only the four
- bitmaps needed.
-
- Packing Data into Bit Fields
- ----------------------------
- The code fragment should use the value 0 rather than
- OFFSETIN(MYCTL, Language). The OFFSETIN macro cannot be used
- directly with a bit field. To use OFFSETIN with bit fields,
- place the bit fields in a nested structure. Then give the name
- of the structure as an argument to the OFFSETIN macro.
-
- The EVENTINFO Structure
- -----------------------
- The EVENTINFO structure has an additional field, fl, that occurs
- at the end of the structure. This field can either be 0 or it
- can contain one flag: EF_fNoUnload. When this flag is set, it
- tells Visual Basic not to allow unloading of the current form or
- any control on the form, while the corresponding event procedure
- is being fired. The EF_fNoUnload flag is useful for events that
- must assume that nothing will be unloaded. (The standard Paint
- event is an example.)
-
-
- ===============================================================================
- Part 2: Additional API Calls
- ===============================================================================
-
- LPSTR FAR PASCAL VBGetControlName(HCTL hctl, LPSTR lpszName)
-
- Copies the name of the specified control into a buffer pointed to by
- lpszName. This name is the same as the setting of the CtlName property,
- which is unavailable at run time, except through this function. You must
- create a buffer of at least 41 bytes, because the function copies
- the entire control name and does not truncate. The string copied is
- null-terminated.
-
- hctl HCTL -- Handle to the control.
-
- lpszName LPSTR -- Pointer to the buffer to receive the string
- data.
-
-
- LONG FAR PASCAL VBSeekFormFile(HFORMFILE hformfile, LONG offset)
-
- Moves the current position within a form file. See VBReadFormFile and
- VBWriteFormFile in the "Control Development Guide," for more information
- on form files and how to get handles to them. When using this function,
- make sure that you never seek past the end or before the beginning of a
- file.
-
- hformFile HFORMFILE -- Handle to a form file.
-
- offset LONG -- Position in the file to which to move, measured
- in distance in bytes from beginning of the file.
-
-
- LONG FAR PASCAL VBRelSeekFormFile(HFORMFILE hformfile, LONG offset)
-
- Moves the current position within a form file forward or backward by
- the indicated distance. This function is the same as VBSeekFormFile,
- except that the position given is relative to the current file position.
- When using this function, make sure that you never seek past the end or
- before the beginning of a file.
-
- hformFile HFORMFILE -- Handle to a form file.
-
- offset LONG -- Distance, measured in bytes, to move forward
- in the file. Negative value moves file position
- backward.
-
-
- ===============================================================================
- Part 3: Miscellaneous Notes and Tips
- ===============================================================================
-
- Assembling the LIBINIT.ASM File
- -------------------------------
- Use of an assembler is never required with the Control Development Kit.
- Each makefile provided in the source code directories will invoke the
- assembler, but only if the file LIBINIT.OBJ is missing. If you delete
- this OBJ file, you can copy it from the distribution disk or from another
- source code directory. All versions of LIBINIT.OBJ provided are identical.
-
-
- Debugging a Custom Control File
- -------------------------------
- To debug a custom control file, you need to use CodeView for Windows,
- version 3.0 or later. Use CodeView to debug VB.EXE, but when prompted
- for debugging information, specify the VBX file you wish to debug.
- Alternatively, you can start CodeView for Windows and use the /L option
- on the command line to load debugging information:
-
- CVW /L PIX.VBX VB.EXE
-
- To debug your custom control file, set a breakpoint in the VBX source
- file, start Visual Basic, either add the VBX file to the project or load
- a project that uses the VBX file, and then create an instance of one
- of the controls.
-
-
- Duplicate Custom Control Names
- ------------------------------
- Each control class should be identified with a unique class name. Visual
- Basic does not register a control class if a class with that name is
- already loaded.
-
- Each VBX file should be uniquely identified. If any two VBX files (or
- other Windows DLLs) are defined with the same name in their respective
- module-definition files, then loading the second VBX file in the same
- session of Windows causes Windows to use the first VBX, even though the
- actual VBX files may be completely different.
-
- For this reason, all VBX files should be kept in one location, with
- their file name matching the name in the module-definition file. This
- way, two different VBX files with the same name in the module-definition
- file cannot reside in the same system, because their file names would
- also have to be identical.
-
- For similar reasons, it's a good idea to uniquely identify each release
- of a custom control file by indicating the release number in the module-
- definition file, as well as in the name of the VBX file. For example, to
- indicate the first release of the PIX control, you could use a LIBRARY
- statement such as:
-
- LIBRARY PIX100
-