home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 21.ddi / CDK.TX_ / CDK.bin
Encoding:
Text File  |  1993-02-14  |  8.4 KB  |  218 lines

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