home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / activexcontrol / basectl / todosvr / todoppg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  4.7 KB  |  151 lines

  1. //=--------------------------------------------------------------------------=
  2. // ToDoPPG.Cpp
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995-1997 Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // property page implementations for ToDo control.
  13. //
  14. #include "IPServer.H"
  15.  
  16. #include "LocalObj.H"
  17. #include "ToDoPPG.H"
  18. #include "ToDoCtl.H"
  19. #include "Resource.H"
  20. #include "Util.H"
  21.  
  22.  
  23. // for ASSERT and FAIL
  24. //
  25. SZTHISFILE
  26.  
  27. //=--------------------------------------------------------------------------=
  28. // Property Page messages
  29. //=--------------------------------------------------------------------------=
  30. // in addition to regular windows messages you'll receive for a dialog box,
  31. // you'll receive the following messages in your property page implementation:
  32. //
  33. // PPM_NEWOBJECTS:
  34. //    wParam = 0;
  35. //    lParam = (LPARAM)(HRESULT *)&hr
  36. //
  37. //  - in this message, you should call FirstControl() to get a pointer to a
  38. //    control, and initialize the values in the property page dialog with
  39. //    values from the control object.  put results from the operation in
  40. //    the HRESULT pointed to by LPARAM.
  41. //
  42. // PPM_APPLY:
  43. //    wParam = 0;
  44. //    lParam = (LPARAM)(HRESULT *)&hr
  45. //
  46. //  - this message is sent to your dialog whenever the user clicks APPLY or OK
  47. //    in the dialog.  you should have a loop with the following code in it:
  48. //
  49. //      for (pUnk = FirstControl(&dwCookie) ; pUnk; pUnk = NextControl(&dwCookie)) {
  50. //            hr = pUnk->QueryInterface(IID_IMyCtlInterface, (void **)&pMyCtl);
  51. //            // set properties here!!!
  52. //      }
  53. //
  54. //    call PropPageException() if there is an error while setting propertites
  55. //    to show the exception set up by the property set routine.
  56. //
  57. // PPM_EDITPROPERTY:
  58. //    wParam = dispid
  59. //    lParam = (LPARAM)(HRESULT *)&hr
  60. //
  61. //  - sent to your dialog when somebody wants you to set the focus to a specific
  62. //    property [typically, one will see a call to this when one returns a page
  63. //    from IPerPropertyBrowsing::MapPropertyToPage].  you can use this
  64. //    to bring up dialogs, or do whatever flaps your flagella.
  65. //
  66. // PPM_FREEOBJECTS:
  67. //    wParam = 0
  68. //    lParam = (LPARAM)(HRESULT *)&hr
  69. //
  70. // - sent to your dialog when you should free up any objects.  some people will
  71. //   find it interesting to QI and store objects in the PPM_INITOBJECTS message.
  72. //   this message tells the prop page that these objects are no longer valid,
  73. //   and any stashing of objects should be terminated.
  74. //
  75.  
  76. //=--------------------------------------------------------------------------=
  77. // CToDoGeneralPage::Create
  78. //=--------------------------------------------------------------------------=
  79. // global static creation function.
  80. //
  81. // Parameters:
  82. //    IUnknown *    - [in] controlling unknown
  83. //
  84. // Output:
  85. //    IUnknown *    - new prop page.
  86. //
  87. // Notes:
  88. //
  89. IUnknown *CToDoGeneralPage::Create
  90. (
  91.     IUnknown *pUnkOuter
  92. )
  93. {
  94.     return (IUnknown *)new CToDoGeneralPage(pUnkOuter);
  95. }
  96.  
  97. //=--------------------------------------------------------------------------=
  98. // CToDoGeneralPage::CToDoGeneralPage
  99. //=--------------------------------------------------------------------------=
  100. // constructor.
  101. //
  102. // Parameters:
  103. //    IUnknown *        - [in] controlling unknown.
  104. //
  105. // Notes:
  106. //
  107. CToDoGeneralPage::CToDoGeneralPage
  108. (
  109.     IUnknown *pUnkOuter
  110. )
  111. : CPropertyPage(pUnkOuter, OBJECT_TYPE_PPGTODOGENERAL)
  112. {
  113.     // initialize local variables here.
  114. }
  115.  
  116. //=--------------------------------------------------------------------------=
  117. // CToDoGeneralPage::~CToDoGeneralPage
  118. //=--------------------------------------------------------------------------=
  119. // destructor.
  120. //
  121. // Notes:
  122. //
  123. CToDoGeneralPage::~CToDoGeneralPage()
  124. {
  125.     // clean up
  126. }
  127.  
  128. //=--------------------------------------------------------------------------=
  129. // CToDoGeneralPage::DialogProc
  130. //=--------------------------------------------------------------------------=
  131. // our dialog proc.
  132. //
  133. // Parameters:
  134. //    - see win32sdk docs on DialogProc
  135. //
  136. // Notes:
  137. //
  138. BOOL CToDoGeneralPage::DialogProc
  139. (
  140.     HWND   hwnd,
  141.     UINT   msg,
  142.     WPARAM wParam,
  143.     LPARAM lParam
  144. )
  145. {
  146.     // TODO: add support for your property page here.  this is a normal dialog
  147.     //       proc.  make sure you handle PPM_NEWOBJECTS and PPM_APPLY.
  148.     //
  149.     return FALSE;
  150. }
  151.