home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / BCPPOWL1.ZIP / OWLDOC.ZIP / MANUAL.DOC < prev   
Encoding:
Text File  |  1991-08-28  |  19.1 KB  |  528 lines

  1. ================================================================== 
  2. ObjectWindows for C++ Reference Guide  CORRECTIONS & ADDITIONS 
  3. ================================================================== 
  4.  
  5. *****PART 1*****
  6.  
  7. Chapter 1, "ObjectWindows classes"
  8. ----------------------------------
  9.  
  10. Page 15 (TButton class):
  11.  
  12. Add the following data member:
  13.  
  14. BOOL IsDefPB;
  15. Indicates whether the button is to be considered the default push 
  16. button. Used for owner-draw buttons. Set by (non-resource) TButton constructor
  17. based on BS_DEFPUSHBUTTON style setting.
  18.  
  19. Page 16 (TButton class):
  20.  
  21. Add the following member functions:
  22.  
  23. virtual void BMSetStyle(RTMessage Msg) = [WM_FIRST + BM_SETSTYLE];
  24. For owner-draw buttons keeps track of whether the owner-draw button
  25. is the default push button when Windows tries to set the style to 
  26. BS_DEFPUSHBUTTON. Otherwise just calls DefWndProc.
  27.  
  28. virtual void SetupWindow();                               protected
  29. Sends a DM_SETDEFID message to the parent window if the button is the
  30. default push button and an owner-draw button.
  31.  
  32. virtual void WMGetDlgCode(RTMessage Msg) = [WM_FIRST + WM_GETDLGCODE];
  33. Responds to WM_GETDLGCODE messages from the dialog manager. For
  34. owner-draw buttons returns information as to whether the button is the
  35. default button. Otherwise it just calls DefWndProc.
  36.  
  37. Page 22 (TComboBox class): 
  38.  
  39. Add the following member functions: 
  40.  
  41. void Clear(); 
  42. Clears the text of the associated edit control.
  43.  
  44. int GetEditSel(Rint StartPos, Rint EndPos); 
  45. Returns, in the specified reference parameters, the starting and
  46. ending positions of the text selected in the associated edit control.
  47. Returns CB_ERR if the combo box has no edit control.
  48.  
  49. int GetText(LPSTR AString, int MaxChars); 
  50. Fills the specified string with the text of the associated edit
  51. control (up to MaxChars). Returns the number of characters copied.
  52.  
  53. int GetTextLen(); 
  54. Returns the length of the text in the associated edit control.
  55.  
  56. int SetEditSel(int StartPos, int EndPos); 
  57. Selects characters which are between StartPos and EndPos in the
  58. edit control of the combo box. Returns CB_ERR if the combo box 
  59. does not have an edit control.
  60.  
  61. void SetText(LPSTR AString); 
  62. Selects the first string in the associated list box which begins
  63. with the supplied AString. If there is no match, sets the contents
  64. of the associated edit control to the supplied string (and selects
  65. it).
  66.  
  67. Pages 24 and 25 (TControl class):
  68.  
  69. Change see also reference from TWindowsObject::WMDrawItem to 
  70. TControl::WMDrawItem.
  71.  
  72. Change see also references TWindow::DrawItem and TWindow::WMDrawitem
  73. to TWindowsObject::DrawItem and TWindowsObject::DrawItem.
  74.  
  75. Pages 52 and 53 (TListBox class):
  76.  
  77. The TListBox member functions which are described as being for
  78. single-selection list boxes are inherited by TComboBox and can also
  79. be used by combo boxes. Also, these member functions return -1 for
  80. multiple-selection list boxes. (See GetSelIndex, GetSelString, SetSelIndex,
  81. and SetSelString.)
  82.  
  83. int GetSelString(LPSTR AString, int Index); 
  84. Change the words: "as long as it is no longer than MaxChars" to "(up to
  85. MaxChars in length)."
  86.  
  87. Add the following member functions: 
  88.  
  89. int GetSelCount();
  90. Returns the number of selected items in the list box. For single- or
  91. multiple-selection list boxes (and combo boxes).
  92.  
  93. int GetSelIndexes(Pint Indexes, int MaxCount);
  94. For multiple-selection list boxes. Fills the Indexes array with the indexes of
  95. up to MaxCount selected strings. Returns the number of items put in 
  96. Indexes (-1 for single-selection list boxes and combo boxes).
  97.  
  98. int GetSelStrings(LPSTR *Strings, int MaxCount, int MaxChars);
  99. For multiple-selection list boxes. Retrieves the currently selected 
  100. items, putting up to MaxCount of them in Strings. Each entry in the Strings
  101. array should have space for MaxChars characters and a terminating 
  102. null. Returns the number of items put into Strings (-1 for 
  103. single-selection list boxes and combo boxes).
  104.  
  105. Page 53 (TListBox class): 
  106.  
  107. Add the following member functions:
  108.  
  109. int SetSelIndexes(Pint Indexes, int NumSelections, BOOL ShouldSet);
  110. For multiple-selection list boxes. Selects/deselects the strings in 
  111. the associated list box at the indexes specified in the Indexes array.
  112. If ShouldSet is TRUE, the indexed strings are selected and highlighted, if 
  113. ShouldSet is FALSE the highlight is removed and they are no longer selected.
  114. Returns the number of strings successfully selected or deselected (-1 for 
  115. single-selection list boxes and combo boxes). If NumSelections
  116. is less than zero, all strings are selected or deselected, and a
  117. negative value is returned on failure.
  118.  
  119. int SetSelStrings(LPSTR *Prefixes, int NumSelections, BOOL ShouldSet);
  120. For multiple-selection list boxes. Selects the strings in the associated 
  121. list box which begin with the prefixes specified in the Prefixes array.
  122. For each string the search begins at the beginning of the list and continues
  123. until a match is found or until the list has been completely traversed. If
  124. ShouldSet is TRUE, the matched strings are selected and highlighted, if
  125. ShouldSet is FALSE the highlight is removed from the matched strings
  126. and they are no longer selected. Returns the number of strings
  127. successfully selected or deselected (-1 for single-selection list boxes
  128. and combo boxes). If NumSelections is less than zero, all strings are
  129. selected or deselected, and a negative value is returned on failure.
  130.  
  131. Page 54 (TMDIClient class):
  132.  
  133. Correct the second form of the constructor as follows:
  134.  
  135. TMDIClient(PTMDIFrame AParent, HWND AnHWindow, PTModule AModule = NULL);
  136. When invoking TWindow's constructor, passes AHWindow and AModule.
  137.  
  138. Page 55:
  139.  
  140. Correct the destructor as follows: virtual ~TMDIClient();
  141.  
  142. Add the following member function: 
  143.  
  144. virtual void WMMDIActivate (RTMessage) = [WM_FIRST + 
  145.                      WM_MDIACTIVATE];                     protected
  146.  
  147. Responds to an incoming WM_MDIACTIVATE message. Overrides
  148. TWindow::WMMDIActivate and instead calls DefWndProc. If you redefine
  149. WMMDIActivate in a derived class, be sure to invoke the WMMDIActivate
  150. of the base class after any other processing (unless you have a 
  151. special reason for invoking it previously).
  152.  
  153. Page 56 (TMDIFrame class):
  154.  
  155. Add the following data member:
  156.  
  157. PTWindow ActiveChild;
  158. ActiveChild points to the TMDIFrame's active MDI child window.
  159. ActiveChild is set by the child in its WMMDIActivate message response
  160. member function. TMDIFrame's constructors initialize ActiveChild and it
  161. is read and written by the read and write functions.
  162.  
  163. Page 60 (TMDIFrame class):
  164.  
  165. Add the following member function: 
  166.  
  167. virtual void WMActivate(RTMessage Msg) = [WM_FIRST + WM_ACTIVATE]; protected
  168.  
  169. Responds to an incoming WM_ACTIVATE message. Since an MDI child
  170. doesn't get WM_MDIACTIVATE messages when its frame window gets
  171. activated and deactivated, the active child's ActivationResponse
  172. member function is called here.
  173. See also TWindow::ActivationResponse, TWindowsObject::WMActivate
  174.  
  175. Page 64 (TRadioButton class):
  176.  
  177. virtual void BNClicked(RTMessage Msg) = [NF_FIRST + BN_CLICKED];   protected
  178.  
  179. Responds to an incoming BN_CLICKED Windows message.
  180.  
  181. Page 73 (TScroller::AutoScroll): 
  182. Delete see also: TWindow::WMTimer (WMTimer does not exist).
  183.  
  184. Page 79 (TStatic class): 
  185.  
  186. Add the following member function:
  187.  
  188. int GetTextLen() 
  189. Returns the length of the static control's text.
  190.  
  191. Page 81 (TWindow class):
  192.  
  193. Add to the description of the constructor:
  194.  
  195. TWindow(PTWindowsObject AParent, LPSTR ATitle, PTModule AModule = NULL);
  196.  
  197. If AParent is an MDI frame window, this is created as a MDI
  198. child window (the WB_MDICHILD flag is set).  If the new TWindow is
  199. a popup window (and therefore should not be created as a MDI
  200. child window) then SetFlags(WB_MDICHILD, FALSE) must be called
  201. after this is constructed, and before it is created.
  202.  
  203. Correct the second form of the constructor as follows:
  204.  
  205. TWindow(HWND AnHWindow, PTModule AModule = NULL);
  206. Invokes TWindowsObject constructor passing AnHWindow and AModule.
  207.  
  208. Page 82 (TWindow class):
  209.  
  210. Add the following member function:
  211.  
  212. virtual void ActivationResponse(WORD Activated,  BOOL IsIconified);
  213. Called by WMActivate and WMMDIActivate to provide a keyboard interface
  214. for the controls of a window. First calls TWindowsObject::ActivationResponse.
  215. When the window is deactivated (Activated equals zero) saves 
  216. the handle of  the child control that currently has the focus in 
  217. FocusChildHandle. When the window is activated, sets the focus to the
  218. child whose handle was stored. 
  219. See also: TWindowsObject::EnableKBHandler, TWindow::WMMDIActivate
  220.  
  221. Page 84: (TWindow class):
  222.  
  223. Replace WMActivate with the following member function:
  224.  
  225. virtual void WMMDIActivate (RTMessage) = [WM_FIRST + 
  226.                      WM_MDIACTIVATE];                       protected
  227.  
  228. Calls DefWndProc, then responds to an incoming WM_MDIACTIVATE message by setting
  229. the parent's (TMDIFrame) ActiveChild to the window handle sent in the message.
  230. Calls ActivationResponse to provide a keyboard interface for the controls of a 
  231. window. If you redefine WMMDIActivate in a derived class, be sure to invoke
  232. the WMMDIActivate of the base class after any other processing (unless you 
  233. have a special reason for invoking it elsewhere).
  234. See also: TWindow::ActivationResponse
  235.  
  236. Replace WMLButtonDown's declaration with the following:
  237.  
  238. virtual void WMLButtonDown(RTMessage Msg) = [WM_FIRST + WM_LBUTTONDOWN];
  239.  
  240. Page 88 (TWindowsObject class):
  241.  
  242. Following the TWindowsObject constructor description, delete the see also
  243. reference to TWindowsObject::AddChild (does not exist).
  244.  
  245. Add the following member function:
  246.  
  247. virtual void ActivationResponse(WORD Activated, BOOL IsIconified);
  248.  
  249. Called by TWindowsObject::WMActivate and TWindow::ActivationResponse.
  250. If this is being activated (Activated is non-zero) and keyboard
  251. handling has been requested for this, enables keyboard handling
  252. by calling GetApplication()->SetKBHandler; otherwise disables it.
  253. IsIconified is TRUE if the window is minimized, FALSE otherwise.
  254. See also: TWindowsObject::WMActivate, TWindowsObject::EnableKBHandler,
  255.           TApplication::SetKBHandler, TWindow::ActivationResponse
  256.  
  257. Page 91 (TWindowsObject class):
  258.  
  259. Correct the DispatchAMessage member function as follows:
  260.  
  261. virtual void DispatchAMessage(WORD AMsg, RTMessage AMessage,
  262.                      void (TWindowsObject::* _FAR) (RTMessage));
  263.  
  264. Page 98 (TWindowsObject class):
  265.  
  266. Replace description and see also of the WMActivate member function as follows:
  267.  
  268. Responds to an incoming WM_ACTIVATE message. Enables or disables keyboard 
  269. handling by calling ActivationResponse. 
  270.  
  271. Change the WMDrawItem see also TControl::DrawItem to TControl::WMDrawItem.
  272.  
  273. Chapter 2, "Streamable classes"
  274. --------------------------------
  275.  
  276. See online Help for more detailed information on streamable class
  277. member functions with more than one form.
  278.  
  279. Pages 106 and 110 (iopstream, ipstream, and opstream classes):
  280.  
  281. Add to the following to the iopstream(), ipstream(), and opstream()
  282. constructor descriptions:
  283.  
  284. This second form of the constructor (for each of these classes) does
  285. not initialize the buffer pointer bp. Use init to set the buffer and state.
  286. See also: pstream::init
  287.  
  288. Page 107 (ipstream class):
  289.  
  290. Replace descriptions for the following member functions:
  291.  
  292. readString();
  293. Allocates a buffer large enough to contain the
  294. string at the current stream position. Reads the string from the
  295. stream into the buffer. The caller must free the buffer.
  296.  
  297. readString(Pchar buf, unsigned maxLen);
  298. Reads the string at the current stream position
  299. into the buffer specified by buf. Does not read more than maxLen bytes.
  300.  
  301.  
  302. Chapter 3, "ObjectWindows miscellaneous components"
  303. ----------------------------------------------------
  304.  
  305. Page 120: 
  306.  
  307. Correct BUILDER type definition as follows:
  308.  
  309.                  typedef PTStreamable (_FAR *BUILDER)();
  310.  
  311. Page 124:
  312.  
  313. Correct the _FAR macro header file name as follows: _DEFS.H.
  314.  
  315. Page 125:
  316.  
  317. Add the following new function:
  318.  
  319. GetApplicationObject() function                   APPLICAT.H
  320.  
  321. Declaration     extern PTApplication _EXPFUNC GetApplicationObject();
  322.  
  323. Description     This function can be called from within an application
  324.                 or a DLL. If an ObjectWindows application is in control,
  325.                 GetApplicationObject() returns a pointer to that
  326.                 application's application object (PTApplication). 
  327.                 Otherwise, returns NULL.
  328.  
  329. Page 126:
  330.  
  331. Add the following operator:
  332.  
  333.   void operator delete( Pvoid ptr );
  334. ObjectWindows redefines the global operator delete to check 
  335. the safety pool after each deletion. If it is exhausted, 
  336. operator delete attempts to reallocate it. This provides
  337. automatic safety pool restoration whenever it is likely  
  338. to be successful.
  339. See also: SafetyPool::IsExhausted
  340.  
  341. Page 126:
  342.  
  343. New Function:
  344.  
  345.     WORD FAR OWLGetVersion();               owl.h
  346.  
  347.         This function returns the version number of the ObjectWindows
  348.         library.  Returns the value of the constant OWLVersion.  
  349.  
  350. New Constant:
  351.  
  352.     const int OWLVersion;                   owl.h
  353.         This constant can be used to ensure that the version number
  354.         returned from a call to OWLGetVersion is the expected
  355.         version.  This is most useful when using the ObjectWindows
  356.         DLL.  
  357.  
  358. Page 130 (TComboBoxData class):
  359.  
  360. Change the last sentence of AddString as follows:
  361.  
  362. If IsSelected is TRUE, deletes Selection before reallocating a copy of
  363. AString as Selection.
  364.  
  365. *****PART 2*****
  366.  
  367. Chapter 4, "Windows functions"
  368. -------------------------------
  369.  
  370. Page 149 (AnimatePalette function): 
  371. The last LPPALETTEENTRY Palette parameter should be PaletteColors.
  372.  
  373. Page 157:
  374.  
  375. Add the following information about the old ChangeMenu function:
  376.  
  377. Replaced in Windows 3.0 with AppendMenu, DeleteMenu, InsertMenu, 
  378. ModifyMenu, and RemoveMenu.
  379.  
  380. Page 197: 
  381.  
  382. Add the following ExtDeviceMode function:
  383.  
  384. Definition: int ExtDeviceMode(HWND Wnd, HANDLE Driver, DEVMODE FAR * 
  385. DevModeOutput, LPSTR DeviceName, LPSTR Port, DEVMODE FAR * DevModeInput, 
  386. LPSTR Profile, WORD Mode);
  387.  
  388. Provides device initialization information for a printer's device driver. 
  389. The application must include DRIVINIT.H. 
  390. Parameters: 
  391. Wnd     Identifies a window (could be the parent of an application-called 
  392. dialog box). 
  393.  
  394. Driver     Device-driver module identifier. See GetModuleHandle and  
  395. LoadLibrary functions.
  396.  
  397. DevModeOutput     Pointer to a DEVMODE structure.
  398.  
  399. DeviceName     Pointer to a null-terminated character string device name.
  400.  
  401. Port     Pointer to the string containing the port connecting the device.
  402.  
  403. DevModeInput     Pointer to a DEVMODE structure with driver initialization 
  404. information.
  405.  
  406. Profile     Pointer to string containing the name of the initialization  
  407. file. If NULL, default is WIN.INI.
  408.  
  409. Mode     Specifies operations. 
  410.    Mode Value                       Meaning 
  411.    ---- -----                       ------- 
  412.    0                                See Returns: 
  413.    DM_COPY        Writes driver's current settings to DEVMODE 
  414.    DM_MODIFY      Changes settings 
  415.    DM_PROMPT      Gets user specifications from dialog box 
  416.    DM_UPDATE      Writes settings to environment and WIN.INI
  417.  
  418. Returns: 
  419. If Mode is 0, returns size (in bytes) of DevModeInput structure. Dialog 
  420. box return values are IDOK or IDCANCEL. A successful function returns 
  421. IDOK, a failure returns less than 0.
  422. See also GetProcAddress
  423.  
  424. Page 198:
  425.  
  426. Add the following FatalAppExit function:
  427.  
  428. Definition:  void FatalAppExit(WORD action, LPSTR MessageText);
  429.  
  430. Last choice for terminating. Displays a message but may not be able  
  431. to free memory, close files, and may cause a general failure of Windows.
  432.  
  433. Parameters: 
  434. Action     Reserved. Must be set to 0.
  435.  
  436. MessageText     Pointer to the displayed 35-character string.   
  437. 
  438.  
  439.  
  440.  
  441.  
  442.  
  443. ==================================================================
  444. ObjectWindows for C++ Programmer's Guide   CORRECTIONS & ADDITIONS
  445. ==================================================================
  446.  
  447. Part 1, "Learning ObjectWindows"
  448.  
  449.  Chapter 2, "Stepping through Windows"
  450.  
  451.   Page 30
  452.    Replace the paragraph directly about the heading "Creating the
  453.    resource file" with the following:
  454.        If you use one of these DLLs, you must use the other. So an 
  455.        application that uses the ObjectWindows DLL must also use the
  456.        Borland C++ run-time library DLL, and vice versa. If you use 
  457.        these DLLs, you must compile your application in the large 
  458.        memory model (-ml for the command line compiler, or the 
  459.        Options|Compiler|Code Generation menu option in the IDE) and
  460.        with the smart callbacks option (-WS for the command line 
  461.        compiler, or the Options|Compiler|Entry/Exit Code menu 
  462.        option in the IDE). Also, since the container class library is
  463.        contained with the ObjectWindows DLL (OWL.DLL), if you use the
  464.        ObjectWindows DLL, you don't need to explicitly link in a 
  465.        container class library.
  466.  
  467.   Page 33
  468.    Replace the sentence "The correct container class library for an 
  469.    application that uses the ObjectWindows DLL, the Borland C++ run-time 
  470.    library DLL, or an ObjectWindows user DLL is TCLASSDL.LIB." with 
  471.    "If you are using the ObjectWindows DLL, you don't need to explicitly
  472.    link a container class library."
  473.  
  474.    Replace the paragraph 
  475.     You may with to dynamically link the Borland C++ run-time library to 
  476.     your application. Doing so will descrease the size of the your .EXE
  477.     file. Simply add the import library BCRTL.LIB to your project.
  478.    with
  479.     If you are using an ObjectWindows DLL, you must link the Borland C++ 
  480.     run-time library to your application. Doing so will decrease the size 
  481.     of the your .EXE file. Simply add the import library CRTLL.LIB to your 
  482.     project.
  483.  
  484.    Add a new bulleted paragraph before the last item in the bulleted 
  485.    list:
  486.     If you are statically linking an ObjectWindows library (OWLWx.LIB),
  487.     you must also statically link the new Windows global memory 
  488.     suballocator library. Just add SALLOCWx.LIB (where "x" indicates 
  489.     the memory model) to your project.
  490.  
  491.    Replace the command-line example
  492.       BCCX -WE myprog.cpp owlws.lib tclassws.lib
  493.    with
  494.       BCCX -WE myprog.cpp owlws.lib sallocws.lib tclassws.lib
  495.     This command first compiles MYPROG.CPP then links it with OWLWS.LIB,
  496.     SALLOCWS.LIB, and TCLASSWS.LIB
  497.  
  498.    Replace the command-line example
  499.       BCCX -WS -ml myprog.cpp owl.lib tclassdl.lib bcrtl.lib
  500.    with
  501.       BCCX -WS -ml myprog.cpp owl.lib crtll.lib
  502.     compiles MYPROG.CPP then links it with the OWL.LIB and CRTLL.LIB 
  503.     import libraries.
  504.  
  505.   Page 39
  506.    Replace the sentence "This is a not a parent as in a base, but more
  507.    like an owner window." with "This is not a parent as in a derived
  508.    class's base class, but more like an owner window."
  509.  
  510.  
  511.  Chapter 6, "Popping up windows"
  512.  
  513.   Page 84
  514.    Delete the semi-colons after the resource ID constants in the four
  515.    #define directives near the middle of the page.
  516.  
  517.  
  518.  
  519. Part 2, "Using ObjectWindows"
  520.  
  521.  Chapter 10, "Window objects"
  522.  
  523.   Page 133
  524.    Replace the statement
  525.        AChildWindow = new TChildWindow(this, "Child Title");
  526.    with
  527.        AChildWindow = new TWindow(this, "Child Title");
  528.