Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
5.4 KiB

  1. //TODO: change CSampleBinary to the name of your binary object
  2. //-----------------------------------------------------------------------------
  3. //
  4. // File: IMPBIN.CPP
  5. //
  6. // Implementation of a CLocBinary Class
  7. //
  8. // Copyright (c) 1995 - 1997, Microsoft Corporation. All rights reserved.
  9. //
  10. //-----------------------------------------------------------------------------
  11. #include "stdafx.h"
  12. #include "dllvars.h"
  13. #include "impbin.h"
  14. #include "misc.h"
  15. #ifdef _DEBUG
  16. #undef THIS_FILE
  17. static char BASED_CODE THIS_FILE[] = __FILE__;
  18. #endif
  19. #define new DEBUG_NEW
  20. ///////////////////////////////////////////////////////////////////////////////
  21. // CSampleBinary
  22. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  23. //
  24. // Default constructor provided for the CreateBinaryObject call
  25. //
  26. //------------------------------------------------------------------------------
  27. CSampleBinary::CSampleBinary()
  28. {
  29. MemberDataInit();
  30. }
  31. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  32. //
  33. // Destructor and member clean up
  34. //
  35. //------------------------------------------------------------------------------
  36. CSampleBinary::~CSampleBinary()
  37. {
  38. }
  39. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  40. //
  41. // Init member data items
  42. //
  43. //------------------------------------------------------------------------------
  44. void
  45. CSampleBinary::MemberDataInit()
  46. {
  47. //TODO: Init data
  48. }
  49. //
  50. // Serialization routines.
  51. //
  52. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  53. //
  54. // Serialize the binary
  55. //
  56. //------------------------------------------------------------------------------
  57. void CSampleBinary::Serialize(CArchive &ar)
  58. {
  59. if (ar.IsStoring())
  60. {
  61. //TODO:
  62. }
  63. else
  64. {
  65. //TODO:
  66. }
  67. }
  68. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  69. //
  70. // Compare the contents of this binary with the binary passed.
  71. //
  72. //------------------------------------------------------------------------------
  73. CLocBinary::CompareCode
  74. CSampleBinary::Compare (const CLocBinary *pComp)
  75. {
  76. //TODO: Some real compare
  77. UNREFERENCED_PARAMETER(pComp);
  78. //TODO change btSample and pidBMOF
  79. LTASSERT((BinaryId)MAKELONG(btBMOF, pidBMOF) == pComp->GetBinaryId());
  80. //If anything has changed that is localizable return fullChange
  81. //If only non localizable data has changed return partialChange
  82. //If the two are identical return noChange
  83. return noChange;
  84. }
  85. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  86. //
  87. // Copy the non localizable data from pBinsource to this object
  88. //
  89. //------------------------------------------------------------------------------
  90. void
  91. CSampleBinary::PartialUpdate(const CLocBinary * pBinSource)
  92. {
  93. //TODO
  94. UNREFERENCED_PARAMETER(pBinSource);
  95. }
  96. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  97. //
  98. // Return the property from this object. Return FALSE for
  99. // properties not implemented
  100. //
  101. //------------------------------------------------------------------------------
  102. BOOL
  103. CSampleBinary::GetProp(const Property prop, CLocVariant &vRet) const
  104. {
  105. UNREFERENCED_PARAMETER(vRet);
  106. //TODO
  107. BOOL bRet = TRUE;
  108. switch(prop)
  109. {
  110. case p_dwXPosition:
  111. break;
  112. case p_dwYPosition:
  113. break;
  114. case p_dwXDimension:
  115. break;
  116. case p_dwYDimension:
  117. break;
  118. default:
  119. bRet = FALSE;
  120. break;
  121. }
  122. return bRet;
  123. }
  124. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  125. //
  126. // Set this binary property. Return FALSE for
  127. // properties not implemented
  128. //
  129. //------------------------------------------------------------------------------
  130. BOOL
  131. CSampleBinary::SetProp(const Property prop, const CLocVariant &var)
  132. {
  133. UNREFERENCED_PARAMETER(var);
  134. //TODO
  135. BOOL bRet = TRUE;
  136. switch(prop)
  137. {
  138. case p_dwXPosition:
  139. break;
  140. case p_dwYPosition:
  141. break;
  142. case p_dwXDimension:
  143. break;
  144. case p_dwYDimension:
  145. break;
  146. default:
  147. bRet = FALSE;
  148. break;
  149. }
  150. return bRet;
  151. }
  152. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  153. //
  154. // Attempt to convert the binary in the CLocItem passed to the new type
  155. //
  156. //------------------------------------------------------------------------------
  157. BOOL
  158. CSampleBinary::Convert(CLocItem *)
  159. {
  160. //TODO:
  161. return FALSE;
  162. }
  163. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  164. // Sub parser IDs have the PARSERID in the HIWORD and the
  165. // Binary ID in the LOWWORD
  166. //-----------------------------------------------------------------------------
  167. BinaryId
  168. CSampleBinary::GetBinaryId(void) const
  169. {
  170. return (BinaryId)MAKELONG(btBMOF, pidBMOF); //TODO: change to real
  171. //binary AND parser ID
  172. }
  173. #ifdef _DEBUG
  174. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  175. //
  176. // Perform asserts on member data
  177. //
  178. //------------------------------------------------------------------------------
  179. void CSampleBinary::AssertValid(void) const
  180. {
  181. CLocBinary::AssertValid();
  182. //TODO: Assert any member variable.
  183. //Note: use LTASSERT instead of ASSERT
  184. }
  185. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  186. //
  187. // Dump the contents of the binary object
  188. //
  189. //------------------------------------------------------------------------------
  190. void CSampleBinary::Dump(CDumpContext &dc) const
  191. {
  192. CLocBinary::Dump(dc);
  193. dc << _T("CSampleBinary Dump\n");
  194. //TODO: dump contents of any member variables
  195. }
  196. #endif