stdafx.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. // stdafx.h : 标准系统包含文件的包含文件,
  2. // 或是经常使用但不常更改的
  3. // 特定于项目的包含文件
  4. #pragma once
  5. #ifndef VC_EXTRALEAN
  6. #define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料
  7. #endif
  8. #include "targetver.h"
  9. #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的
  10. #include <afxwin.h> // MFC 核心组件和标准组件
  11. #include <afxext.h> // MFC 扩展
  12. #ifndef _AFX_NO_OLE_SUPPORT
  13. #include <afxole.h> // MFC OLE 类
  14. #include <afxodlgs.h> // MFC OLE 对话框类
  15. #include <afxdisp.h> // MFC 自动化类
  16. #endif // _AFX_NO_OLE_SUPPORT
  17. #ifndef _AFX_NO_DB_SUPPORT
  18. #include <afxdb.h> // MFC ODBC 数据库类
  19. #endif // _AFX_NO_DB_SUPPORT
  20. #ifndef _AFX_NO_DAO_SUPPORT
  21. #include <afxdao.h> // MFC DAO 数据库类
  22. #endif // _AFX_NO_DAO_SUPPORT
  23. #ifndef _AFX_NO_OLE_SUPPORT
  24. #include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
  25. #endif
  26. #ifndef _AFX_NO_AFXCMN_SUPPORT
  27. #include <afxcmn.h> // MFC 对 Windows 公共控件的支持
  28. #endif // _AFX_NO_AFXCMN_SUPPORT
  29. #include <imapi2.h>
  30. #ifdef USE_STATIC_ICONV // 使用静态库;
  31. #ifndef LIBICONV_EXPORTS
  32. #define LIBICONV_EXPORTS 1
  33. #endif
  34. #ifndef BUILDING_LIBICONV
  35. #define BUILDING_LIBICONV 1
  36. #endif
  37. #ifndef BUILDING_LIBCHARSET
  38. #define BUILDING_LIBCHARSET 1
  39. #endif
  40. #endif
  41. #include <string>
  42. #include <vector>
  43. using namespace std;
  44. #ifndef _UNICODE
  45. typedef string TString;
  46. #else
  47. typedef wstring TString;
  48. #endif
  49. #include "iconv_impl.h"
  50. //#ifndef UNICODE
  51. #include <comutil.h>
  52. #pragma comment(lib,"comsuppw.lib")
  53. //#endif
  54. #include <shlwapi.h> // for SHCreateStreamOnFileEx
  55. ///删除一个数组指针的宏定义
  56. #ifndef DELETEA
  57. #define DELETEA(ptr) \
  58. if(NULL != ptr) \
  59. { \
  60. delete[] ptr; \
  61. ptr = NULL; \
  62. }
  63. #endif
  64. // 删除一个指针的宏定义;
  65. #ifndef FREEP
  66. #define FREEP(ptr) \
  67. if(NULL != ptr) \
  68. { \
  69. free(ptr) ; \
  70. ptr = NULL; \
  71. }
  72. #endif
  73. //删除一个指针的宏定义;
  74. #ifndef DELETEP
  75. #define DELETEP(ptr) \
  76. if(NULL != (ptr)) \
  77. { \
  78. delete (ptr); \
  79. (ptr) = NULL; \
  80. }
  81. #endif
  82. // 删除一个GDI对象的宏定义;
  83. #define DELETEOBJECT(ptr) \
  84. if(NULL != (ptr)) \
  85. { \
  86. ::DeleteObject (ptr);\
  87. (ptr) = NULL; \
  88. }
  89. // Destroy一个Window;
  90. #define DESTROYWINDOW(hWnd) \
  91. if (IsWindow(hWnd)) \
  92. { \
  93. DestroyWindow(hWnd); \
  94. }
  95. #define RELEASEP(ptr)\
  96. if ( ptr)\
  97. {\
  98. ptr->Release();\
  99. ptr = NULL;\
  100. }