home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l406 / 3.ddi / CDK.TX_ / CDK.bin
Encoding:
Text File  |  1992-10-21  |  9.1 KB  |  238 lines

  1.                  CDK.TXT
  2.  
  3.    CDK Notes for Microsoft (R) Visual Basic (TM) Professional Edition
  4.  
  5.                 Version 2.00
  6.  
  7.           (C) Copyright Microsoft Corporation, 1992
  8.  
  9. This document contains release notes for Microsoft Visual Basic for Windows
  10. Professional Edition Version 2.0. Information in this document is more
  11. current than that in the manuals or online Help.
  12.  
  13. CDK Documentation Changes
  14. -------------------------
  15. Page    Section\Note
  16. ----    ------------
  17.  
  18. 105     Packing Data into Bit Fields
  19.     ----------------------------
  20.     The code fragment should use the value 0 rather than
  21.     OFFSETIN(MYCTL, enumLanguage). The OFFSETIN macro cannot be used
  22.     directly with a bit field. To use OFFSETIN with bit fields, place
  23.     the bit fields in a nested structure.  Then give the name of the
  24.     structure as an argument to the OFFSETIN macro.
  25.  
  26. 217     References to the DRAGDROP structure should be changed to
  27.     the DRAGINFO structure.
  28.  
  29. 248     Add Events to the Event List
  30.     ----------------------------
  31.     The note should read:
  32.  
  33.     For Visual Basic 2.0, adding events to the end of the event is
  34.     required.  You must not insert events into the middle of the
  35.     event list.  This is different from Visual Basic 1.0, which
  36.     requires events to be added in sorted order.
  37.  
  38. VOID VBSetCapture(HCTL hctl)  [2.0]
  39. -----------------------------------
  40. Sets the mouse capture to hctl.  When a control has the mouse captured,
  41. all mouse input is directed to that control, regardless of whether the mouse
  42. pointer is over that control.  Only one control can have the mouse captured
  43. at a time.  Similar to Window's SetCapture() API.  See VBGetCapture, and
  44. VBReleaseCapture.
  45.  
  46. VOID VBReleaseCapture(VOID)  [2.0]
  47. ----------------------------------
  48. Releases the mouse capture and restores normal input processing.  This
  49. function should be called after VBSetCapture, when the control no longer
  50. wants all mouse input.  Similar to Window's ReleaseCapture() API.  See
  51. VBSetCapture, and VBGetCapture.
  52.  
  53. VBM_SELECTED  [2.0]
  54. -------------------
  55. This message is sent to controls when they are selected and prior
  56. to being displayed in the Properties window.  You can use controls with
  57. this method to change any property related data prior to display, e.g.,
  58. updating the string providing list box items provided by npzEnumList to
  59. DT_ENUM properties.
  60.  
  61.  wp         = MultiSelect ON (TRUE) or OFF (FALSE)
  62.  
  63. VBM_SETPROPERTY
  64. ---------------
  65. If VBDefControlProc processes this message, the text that is passed with the
  66. WM_SETTEXT message sets the 256th byte to NULL if the original text string
  67. is greater than 256 bytes.
  68.  
  69. VBLinkMakeItemName(HCTL hctl, LPSZ lpszBuf)  [2.0]
  70. --------------------------------------------------
  71. This function adds control array indexes to the name passed in lpszBuf.
  72. For instance, if the lpszBuf contains the string "foo" and hctl is a control
  73. array element 3, lpszBuf contains "foo(3)" upon return from this function.
  74. If hctl is not a control array element, the string will remain "foo."
  75. Control developers must ensure that lpszBuf is sufficiently large to have
  76. appended a 7-character string.
  77.  
  78. Printing 256-color Controls
  79. ---------------------------
  80. In order for custom controls to print correctly, they cannot use the
  81. StretchBlt and BitBlt Windows API functions - these functions do not
  82. transfer color information correctly when displaying to a memory device
  83. context. Refer to the PIX sample for a alternative way of printing
  84. 256-color controls.
  85.  
  86. DT-HLSTR Properties and PF_fGetData
  87. ------------------------------------
  88. DT_HLSTR properties cannot use PF_fGetData by itself.  They must also use
  89. PF_fGetMsg to avoid returning a NULL hlstr.  See the MyTag property in
  90. the PIX example (PIX.C) for a guide for how to property declare
  91. a hlstr property and process the VBM_GETPROPERTY message.
  92.  
  93. DDE Enabled Controls need to have MODEL_fLoadMsg set
  94. -----------------------------------------------------
  95. All DDE-enabled controls need to have the MODEL_fLoadMsg flag
  96. set in the the controls MODEL structure so that the control gets
  97. VBM_LOADED and VBM_CREATED messages.
  98.  
  99. Duplicate Custom Control Names
  100. ------------------------------
  101. Each control class should be identified with a unique class name. Visual
  102. Basic does not register a control class if a class with that name is
  103. already loaded.
  104.  
  105. Each .VBX file should be uniquely identified. If any two .VBX files (or
  106. other Windows DLLs) are defined with the same name in their respective
  107. module-definition files, then loading the second .VBX file in the same
  108. session of Windows causes Windows to use the first .VBX, even though the
  109. actual .VBX files may be completely different.
  110.  
  111. For this reason, all .VBX files should be kept in one location, with
  112. their file names matching the name in the module-definition file. This
  113. way, two different .VBX files with the same name in the module-definition
  114. file cannot reside on the same system, because their file names would
  115. also have to be identical.
  116.  
  117. For similar reasons, it's a good idea to uniquely identify each release
  118. of a custom control by indicating the release number in the module-
  119. definition file, as well as in the name of the .VBX file. For example, to
  120. indicate the first release of the PIX control, you could use a LIBRARY
  121. statement such as:
  122.  
  123.     LIBRARY     PIX100
  124.  
  125. It is also useful to append a company name to the front of the control name
  126. to distinguish it from similar controls shipped by different vendors.
  127.  
  128. Custom Property of Type DT_HLSTR (which uses PF_fSetMsg)
  129. --------------------------------------------------------
  130. When a control receives a VBM_SETPROPERTY message for a custom property of
  131. type DT_HLSTR, then the lp parameter contains an hlstr which is to be the
  132. new value of the property.  However, the control does not own this hlstr,
  133. since it is owned by the caller of VBSetControlProperty. Hence, it cannot
  134. be directly used but rather must be copied (VBSetHlstr can be used for this
  135. purpose).  Also, one must NOT free this hlstr.  That is, you must not pass
  136. this hlstr to VBGetHlstr(), since this VB API has the side effect of
  137. freeing the hlstr passed in if it was a temp hlstr.  Also, you must not
  138. pass this hlstr to VBDestroyHlstr().
  139.  
  140. See the PIX sample for an example of a DT_HLSTR property using PF_fSetMsg
  141. and PF_fGetMsg.
  142.  
  143. New Layout for Custom Control Samples
  144. -------------------------------------
  145. The sample files are now made up of the following:
  146.  
  147.    <name>.c
  148.    <name>.h
  149.    <name>.def
  150.    <name>.rc
  151.    <name>.vbx
  152.    <name>cu.bmp
  153.    <name>cd.bmp
  154.    <name>mu.bmp
  155.    <name>eu.bmp
  156.    makefile
  157.  
  158. In some cases there may be an extra .h file.  This file is called
  159. <name>vb1.h and is used when creating a custom control with VB2-only
  160. features which should be loadable into VB1 as well (see Appendix A of the
  161. documentation)
  162.  
  163. The makefile takes advantage of this structure so that when building a
  164. new custom control, the only line that must change in the makefile is
  165. the PRODUCT line.
  166.  
  167. The contents of the CCINIT.C file are now been included in <name>.c so that
  168. there is only one source to modify.  The WEP code also been included in
  169. the <name>.c file.
  170.  
  171. The LIBINIT.OBJ and LIBINIT.ASM files have been removed from the sample
  172. directories.  They are not required for C7 compilation.  Their equivalents,
  173. LIBENTRY.OBJ and LIBENTRY.ASM, are provided in the CDK directory; these are
  174. only required for C6 compilation.
  175.  
  176.  
  177. List of Included Samples
  178. ------------------------
  179. The samples included with the CDK are:
  180.  
  181.    CIRC1
  182.    CIRC2
  183.    CIRC3
  184.    CNTR
  185.    PAL
  186.    PIX
  187.    PUSH
  188.    XLIST
  189.  
  190. CIRC1 and CIRC2
  191. ---------------
  192. Similar to the CIRCLE samples shipped with VB1, but these are in the
  193. new format.  Also, the HWnd property and MODEL_nValueProp properties
  194. are defined in these controls; they are still loadable into both VB1
  195. and VB2.
  196.  
  197. CIRC3
  198. -----
  199. Similar to CIRCLE3 of VB1.  This sample shows the following features:
  200.  
  201. - How a control can export its model information so that
  202.   a loading application can read it without actually registering the class.
  203.  
  204. - How a control can keep track of the number of instances of the VBX have
  205.   been registered and respond accordingly.
  206.  
  207. - Includes the HelpContextID standard property, which is a new property for
  208.   VB2.  The control must thus use the technique described in Appendix B so
  209.   that it can be loaded by both VB1 and VB2.
  210.  
  211. - HWnd property and MODEL_nValueProp defined
  212.  
  213. CNTR
  214. ----
  215. Similar to the sample shipped with VB1, but in the new format.  This
  216. control sets the MODEL_nValueProp field and exports the model
  217. information.
  218.  
  219. PIX and PUSH
  220. ------------
  221. Similar to the respective samples shipped with VB1, but these are in the
  222. new format.  In addition, these samples both define MODEL_nValueProp. They
  223. are both loadable into VB1 and VB2.  The PIX control contains 256-color
  224. support for both displaying and printing. PIX contains sample DDE code.
  225.  
  226. PAL
  227. ---
  228. This is a new sample for VB2.  It displays the use of the palette
  229. management features.  The sample shows how to prevent a control
  230. from being loaded into VB1.  The control also exports its model
  231. information.
  232.  
  233. XLIST
  234. -----
  235. This is a new sample for VB2.  It displays the use of property
  236. arrays.  This sample also displays how to write a control which
  237. can be loaded into both VB1 and VB2.
  238.