home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / c / WINCLASS.ZIP / README2 < prev    next >
Encoding:
Text File  |  1991-05-28  |  3.1 KB  |  74 lines

  1.     Here I am again...
  2. A couple of months ago I put together some base classes for windows
  3. development and uploaded them on to Compuserve. I didn't at the time
  4. relize how popular they would be.
  5.  
  6. With these files I would like to address the biggest complaint I've
  7. had about the windows classes, namely the inability to call
  8. class member functions of the standard window from inside WndProc.
  9.  
  10. What's included:
  11.     Test.h    // Defines the dialog class for this app.
  12.     Testm.h   // Defines menu selections
  13.     Test.cpp  // Main program
  14.     Test.res  // The menu, icon, and dialog
  15.     Test.def  // Keeps the linker happy
  16.  
  17.     Winbase.h  // Base window class and base registration class
  18.     SWin.h     // A standard window class that includes Registration
  19.                     and display
  20.     Dlgbase.h  // Base dialog class
  21.     readme2    // This piece of great literature
  22.  
  23. To build the new demo type:
  24.  
  25. C:\BORLANC\BIN> bccx -WS -v test
  26. C:\BORLANDC\BIN> rc test.res test.exe
  27.  
  28. So how does this work and what changed from the last version?
  29.     WINBASE.H includes two classes, WindowRegClass and Windows these are
  30. used to build derived classes like StdWindow in SWIN.H they can also be used
  31. to build a non "standard window". To build a non-standard window use the 
  32. base classes to define a window or derive a class from them that defines 
  33. your window. 
  34. To build a standard type window as I've defined it, use the StdWindow
  35. class defined in SWIN.H (menu's, icon's, and cursor's are optional).
  36. Send it:
  37.     1. The window title
  38.     2. The program instance from the winmain parameter
  39.     3. The previous instance of the program also from winmain parameters
  40.     4. Menu name   // optional
  41.     5. Icon name   // optional
  42.     6. Cursor name // optional
  43.  
  44. Define a procedure called WndProc:
  45. long FAR PASCAL _export StdWindow::WndProc(HWND hwnd,WORD message,
  46.                             WORD wParam,LONG lParam)
  47.  
  48. That's it.....and they said windows programming was hard!...
  49.  
  50.     The dialog class, however, is different. You MUST build a derived
  51. class from it and define the dialogs procedure as a member function
  52. (See Test.h for an example).
  53.  
  54.     Now, the changes from last version. The main change is the
  55. standard window class. In the previous version registration and
  56. display were done manually. Why? I don't know... So, I brought
  57. the whole main window process together in one class and made the
  58. window procedure ( WndProc ) a member of the class. The reduced
  59. size of the class calls makes it easier to use BUT makes it very
  60. hard to customize the main window. The addition of WndProc to the
  61. StdWindow class now allows you to access the member functions of
  62. StdWindow ( These you will have to write yourself.....).
  63.  
  64. As before feel free to distribute this freely.
  65. If you do add some good member functions or anything else
  66. how about sending me a copy?...
  67.        Thanks for all the positive comments I've received on the
  68. classes and I hope these new ones help.
  69.  
  70. I can be reached on CompuServe, but I don't know how.
  71. Davin S. Hills
  72. 3800 Harding Rd. #28
  73. Des Moines, Iowa 50310
  74.