home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / include / afxpriv2.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  6KB  |  226 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. // Note: This header file contains useful classes that are documented only
  12. //  in the MFC Technical Notes.  These classes may change from version to
  13. //  version, so be prepared to change your code accordingly if you utilize
  14. //  this header.  In the future, commonly used portions of this header
  15. //  may be moved and officially documented.
  16.  
  17. #ifndef __AFXPRIV2_H__
  18. // Do not define __AFXPRIV2_H__ here.  It is defined at the bottom.
  19.  
  20. #ifndef __AFXPRIV_H__
  21.     #include <afxpriv.h>
  22. #endif
  23.  
  24. #ifdef _AFX_MINREBUILD
  25. #pragma component(minrebuild, off)
  26. #endif
  27. #ifndef _AFX_FULLTYPEINFO
  28. #pragma component(mintypeinfo, on)
  29. #endif
  30.  
  31. #ifdef _AFX_PACKING
  32. #pragma pack(push, _AFX_PACKING)
  33. #endif
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // AFXPRIV2 - MFC Private Classes
  37.  
  38. // General OLE features
  39.  
  40. #if (!defined _AFX_NO_OLE_SUPPORT) && (defined _OBJBASE_H_)
  41.  
  42. // Implementation structures
  43. struct AFX_EVENT;               // Event sink implementation
  44.  
  45. // Classes declared in this file
  46. class COleControlLock;
  47.  
  48. #endif
  49.  
  50. // OLE Automation features
  51.  
  52. #ifdef __AFXDISP_H__
  53. // Classes declared in this file
  54.  
  55. //IStream
  56.     class CArchiveStream;
  57.  
  58. // Functions declared in this file
  59.  
  60. // AfxBSTR2ABTSR
  61. // AfxTaskStringA2W
  62. // AfxTaskStringW2A
  63.  
  64. #endif
  65.  
  66. /////////////////////////////////////////////////////////////////////////////
  67.  
  68. #undef AFX_DATA
  69. #define AFX_DATA AFX_CORE_DATA
  70.  
  71. /////////////////////////////////////////////////////////////////////////////
  72. // General OLE features
  73.  
  74. #if (!defined _AFX_NO_OLE_SUPPORT) && (defined _OBJBASE_H_)
  75. #ifndef __AFXPRIV2_H__OLE__
  76. #define __AFXPRIV2_H__OLE__
  77.  
  78. /////////////////////////////////////////////////////////////////////////////
  79. // Implementation of event sink handling
  80.  
  81. struct AFX_EVENT
  82. {
  83.     enum
  84.     {
  85.         event,
  86.         propRequest, propChanged,
  87.         propDSCNotify
  88.     };
  89.  
  90.     AFX_EVENT(int eventKind);
  91.  
  92.     AFX_EVENT(int eventKind, DISPID dispid, DISPPARAMS* pDispParams = NULL,
  93.         EXCEPINFO* pExcepInfo = NULL, UINT* puArgError = NULL);
  94.  
  95.     int m_eventKind;
  96.     DISPID m_dispid;
  97.     DISPPARAMS* m_pDispParams;
  98.     EXCEPINFO* m_pExcepInfo;
  99.     UINT* m_puArgError;
  100.     BOOL m_bPropChanged;
  101.     HRESULT m_hResult;
  102.     DSCSTATE m_nDSCState;
  103.     DSCREASON m_nDSCReason;
  104. };
  105.  
  106. AFX_INLINE AFX_EVENT::AFX_EVENT(int eventKind)
  107. {
  108.     m_eventKind = eventKind;
  109.     m_dispid = DISPID_UNKNOWN;
  110.     m_pDispParams = NULL;
  111.     m_pExcepInfo = NULL;
  112.     m_puArgError = NULL;
  113.     m_hResult = NOERROR;
  114.     m_nDSCState = dscNoState;
  115.     m_nDSCReason = dscNoReason;
  116. }
  117.  
  118. AFX_INLINE AFX_EVENT::AFX_EVENT(int eventKind, DISPID dispid,
  119.     DISPPARAMS* pDispParams, EXCEPINFO* pExcepInfo, UINT* puArgError)
  120. {
  121.     m_eventKind = eventKind;
  122.     m_dispid = dispid;
  123.     m_pDispParams = pDispParams;
  124.     m_pExcepInfo = pExcepInfo;
  125.     m_puArgError = puArgError;
  126.     m_hResult = NOERROR;
  127.     m_nDSCState = dscNoState;
  128.     m_nDSCReason = dscNoReason;
  129. }
  130.  
  131. /////////////////////////////////////////////////////////////////////////////
  132. // COleControlLock
  133.  
  134. class COleControlLock
  135. {
  136. // Constructors
  137. public:
  138.     COleControlLock(REFCLSID clsid);
  139.  
  140. // Attributes
  141.     CLSID m_clsid;
  142.     LPCLASSFACTORY m_pClassFactory;
  143.     COleControlLock* m_pNextLock;
  144.  
  145. // Implementation
  146. public:
  147.     virtual ~COleControlLock();
  148. };
  149.  
  150. #endif // __AFXPRIV2_H__OLE__
  151. #endif //(!defined _AFX_NO_OLE_SUPPORT) && (defined _OBJBASE_H_)
  152.  
  153. /////////////////////////////////////////////////////////////////////////////
  154. // OLE Automation features
  155.  
  156. #ifdef __AFXDISP_H__
  157. #ifndef __AFXPRIV2_H__DISP__
  158. #define __AFXPRIV2_H__DISP__
  159.  
  160. /////////////////////////////////////////////////////////////////////////////
  161. // CArchiveStream
  162.  
  163. class CArchiveStream : public IStream
  164. {
  165. public:
  166.     CArchiveStream(CArchive* pArchive);
  167.  
  168. // Implementation
  169.     CArchive* m_pArchive;
  170.  
  171.     STDMETHOD_(ULONG, AddRef)();
  172.     STDMETHOD_(ULONG, Release)();
  173.     STDMETHOD(QueryInterface)(REFIID, LPVOID*);
  174.  
  175.     STDMETHOD(Read)(void*, ULONG, ULONG*);
  176.     STDMETHOD(Write)(const void*, ULONG cb, ULONG*);
  177.     STDMETHOD(Seek)(LARGE_INTEGER, DWORD, ULARGE_INTEGER*);
  178.     STDMETHOD(SetSize)(ULARGE_INTEGER);
  179.     STDMETHOD(CopyTo)(LPSTREAM, ULARGE_INTEGER, ULARGE_INTEGER*,
  180.         ULARGE_INTEGER*);
  181.     STDMETHOD(Commit)(DWORD);
  182.     STDMETHOD(Revert)();
  183.     STDMETHOD(LockRegion)(ULARGE_INTEGER, ULARGE_INTEGER,DWORD);
  184.     STDMETHOD(UnlockRegion)(ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
  185.     STDMETHOD(Stat)(STATSTG*, DWORD);
  186.     STDMETHOD(Clone)(LPSTREAM*);
  187. };
  188.  
  189. /////////////////////////////////////////////////////////////////////////////
  190. // Global UNICODE<>ANSI translation helpers
  191.  
  192. void AFXAPI AfxBSTR2CString(CString* pStr, BSTR bstr);
  193.  
  194. #if !defined(_UNICODE) && !defined(OLE2ANSI)
  195. BSTR AFXAPI AfxBSTR2ABSTR(BSTR bstrW);
  196. LPWSTR AFXAPI AfxTaskStringA2W(LPCSTR lpa);
  197. LPSTR AFXAPI AfxTaskStringW2A(LPCWSTR lpw);
  198. #endif
  199.  
  200. #endif // __AFXPRIV2_H__DISP__
  201. #endif // __AFXDISP_H__
  202.  
  203. /////////////////////////////////////////////////////////////////////////////
  204.  
  205. #ifdef _AFX_PACKING
  206. #pragma pack(pop)
  207. #endif
  208.  
  209. #undef AFX_DATA
  210. #define AFX_DATA
  211.  
  212. #ifdef _AFX_MINREBUILD
  213. #pragma component(minrebuild, on)
  214. #endif
  215. #ifndef _AFX_FULLTYPEINFO
  216. #pragma component(mintypeinfo, off)
  217. #endif
  218.  
  219. #if (defined __AFXPRIV2_H__OLE__) && (defined __AFXPRIV2_H__DISP__)
  220. #define __AFXPRIV2_H__
  221. #endif
  222.  
  223. #endif // __AFXPRIV2_H__
  224.  
  225. /////////////////////////////////////////////////////////////////////////////
  226.